title: "User" title_tag: "huaweicloud.Workspace.User" meta_desc: "Documentation for the huaweicloud.Workspace.User resource with examples, input properties, output properties, lookup functions, and supporting types." layout: api no_edit_this_page: true


Manages a Workspace user resource within HuaweiCloud.

## Example Usage

Create a user that never expires

using System.Collections.Generic;
using Pulumi;
using Huaweicloud = Pulumi.Huaweicloud;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var userName = config.RequireObject<dynamic>("userName");
    var emailAddress = config.RequireObject<dynamic>("emailAddress");
    var test = new Huaweicloud.Workspace.User("test", new()
    {
        Email = emailAddress,
        AccountExpires = "0",
        PasswordNeverExpires = false,
        EnableChangePassword = true,
        NextLoginChangePassword = true,
        Disabled = false,
    });

});
package main

import (
    "github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Workspace"
    "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        cfg := config.New(ctx, "")
        userName := cfg.RequireObject("userName")
        emailAddress := cfg.RequireObject("emailAddress")
        _, err := Workspace.NewUser(ctx, "test", &Workspace.UserArgs{
            Email:                   pulumi.Any(emailAddress),
            AccountExpires:          pulumi.String("0"),
            PasswordNeverExpires:    pulumi.Bool(false),
            EnableChangePassword:    pulumi.Bool(true),
            NextLoginChangePassword: pulumi.Bool(true),
            Disabled:                pulumi.Bool(false),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.huaweicloud.Workspace.User;
import com.pulumi.huaweicloud.Workspace.UserArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var config = ctx.config();
        final var userName = config.get("userName");
        final var emailAddress = config.get("emailAddress");
        var test = new User("test", UserArgs.builder()        
            .email(emailAddress)
            .accountExpires("0")
            .passwordNeverExpires(false)
            .enableChangePassword(true)
            .nextLoginChangePassword(true)
            .disabled(false)
            .build());

    }
}
import pulumi
import pulumi_huaweicloud as huaweicloud

config = pulumi.Config()
user_name = config.require_object("userName")
email_address = config.require_object("emailAddress")
test = huaweicloud.workspace.User("test",
    email=email_address,
    account_expires="0",
    password_never_expires=False,
    enable_change_password=True,
    next_login_change_password=True,
    disabled=False)
import * as pulumi from "@pulumi/pulumi";
import * as pulumi from "@huaweicloudos/pulumi";

const config = new pulumi.Config();
const userName = config.requireObject("userName");
const emailAddress = config.requireObject("emailAddress");
const test = new huaweicloud.workspace.User("test", {
    email: emailAddress,
    accountExpires: "0",
    passwordNeverExpires: false,
    enableChangePassword: true,
    nextLoginChangePassword: true,
    disabled: false,
});
configuration:
  userName:
    type: dynamic
  emailAddress:
    type: dynamic
resources:
  test:
    type: huaweicloud:Workspace:User
    properties:
      email: ${emailAddress}
      accountExpires: 0
      passwordNeverExpires: false
      enableChangePassword: true
      nextLoginChangePassword: true
      disabled: false

Create User Resource {#create}

new User(name: string, args: UserArgs, opts?: CustomResourceOptions);
@overload
def User(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         account_expires: Optional[str] = None,
         description: Optional[str] = None,
         disabled: Optional[bool] = None,
         email: Optional[str] = None,
         enable_change_password: Optional[bool] = None,
         name: Optional[str] = None,
         next_login_change_password: Optional[bool] = None,
         password_never_expires: Optional[bool] = None,
         region: Optional[str] = None)
@overload
def User(resource_name: str,
         args: UserArgs,
         opts: Optional[ResourceOptions] = None)
func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
public User(string name, UserArgs args, CustomResourceOptions? opts = null)
public User(String name, UserArgs args)
public User(String name, UserArgs args, CustomResourceOptions options)
type: huaweicloud:Workspace:User
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args UserArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args UserArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args UserArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args UserArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args UserArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

User Resource Properties {#properties}

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The User resource accepts the following input properties:

Email string

Specifies the email address of user. The value can contain 1 to 64 characters.

AccountExpires string

Specifies the user's valid period configuration.

  • Never expires: 0.
  • Expires at a certain time: account expires must in RFC3339 format like yyyy-MM-ddTHH:mm:ssZ. The times is in local time, depending on the timezone.
Description string

Specifies the description of user. The maximum length is 255 characters.

Disabled bool

Specifies whether the user is disabled. Defualts to false.

EnableChangePassword bool

Specifies whether to allow password modification. Defualts to true.

Name string

Specifies the user name.

  • Pure numeric: the valid length is between 1 and 20.
  • Non-pure numeric: the name can contain 1 to 20 characters, only letters, digits, hyphens (-), underscore (_) and dots (.) are allowed. The name must start with a letter.
NextLoginChangePassword bool

Specifies whether the next login requires a password reset. Defualts to true.

PasswordNeverExpires bool

Specifies whether the password will never expires. Defualts to false.

Region string

The region in which to create the Workspace user resource. If omitted, the provider-level region will be used. Changing this will create a new resource.

Email string

Specifies the email address of user. The value can contain 1 to 64 characters.

AccountExpires string

Specifies the user's valid period configuration.

  • Never expires: 0.
  • Expires at a certain time: account expires must in RFC3339 format like yyyy-MM-ddTHH:mm:ssZ. The times is in local time, depending on the timezone.
Description string

Specifies the description of user. The maximum length is 255 characters.

Disabled bool

Specifies whether the user is disabled. Defualts to false.

EnableChangePassword bool

Specifies whether to allow password modification. Defualts to true.

Name string

Specifies the user name.

  • Pure numeric: the valid length is between 1 and 20.
  • Non-pure numeric: the name can contain 1 to 20 characters, only letters, digits, hyphens (-), underscore (_) and dots (.) are allowed. The name must start with a letter.
NextLoginChangePassword bool

Specifies whether the next login requires a password reset. Defualts to true.

PasswordNeverExpires bool

Specifies whether the password will never expires. Defualts to false.

Region string

The region in which to create the Workspace user resource. If omitted, the provider-level region will be used. Changing this will create a new resource.

email String

Specifies the email address of user. The value can contain 1 to 64 characters.

accountExpires String

Specifies the user's valid period configuration.

  • Never expires: 0.
  • Expires at a certain time: account expires must in RFC3339 format like yyyy-MM-ddTHH:mm:ssZ. The times is in local time, depending on the timezone.
description String

Specifies the description of user. The maximum length is 255 characters.

disabled Boolean

Specifies whether the user is disabled. Defualts to false.

enableChangePassword Boolean

Specifies whether to allow password modification. Defualts to true.

name String

Specifies the user name.

  • Pure numeric: the valid length is between 1 and 20.
  • Non-pure numeric: the name can contain 1 to 20 characters, only letters, digits, hyphens (-), underscore (_) and dots (.) are allowed. The name must start with a letter.
nextLoginChangePassword Boolean

Specifies whether the next login requires a password reset. Defualts to true.

passwordNeverExpires Boolean

Specifies whether the password will never expires. Defualts to false.

region String

The region in which to create the Workspace user resource. If omitted, the provider-level region will be used. Changing this will create a new resource.

email string

Specifies the email address of user. The value can contain 1 to 64 characters.

accountExpires string

Specifies the user's valid period configuration.

  • Never expires: 0.
  • Expires at a certain time: account expires must in RFC3339 format like yyyy-MM-ddTHH:mm:ssZ. The times is in local time, depending on the timezone.
description string

Specifies the description of user. The maximum length is 255 characters.

disabled boolean

Specifies whether the user is disabled. Defualts to false.

enableChangePassword boolean

Specifies whether to allow password modification. Defualts to true.

name string

Specifies the user name.

  • Pure numeric: the valid length is between 1 and 20.
  • Non-pure numeric: the name can contain 1 to 20 characters, only letters, digits, hyphens (-), underscore (_) and dots (.) are allowed. The name must start with a letter.
nextLoginChangePassword boolean

Specifies whether the next login requires a password reset. Defualts to true.

passwordNeverExpires boolean

Specifies whether the password will never expires. Defualts to false.

region string

The region in which to create the Workspace user resource. If omitted, the provider-level region will be used. Changing this will create a new resource.

email str

Specifies the email address of user. The value can contain 1 to 64 characters.

account_expires str

Specifies the user's valid period configuration.

  • Never expires: 0.
  • Expires at a certain time: account expires must in RFC3339 format like yyyy-MM-ddTHH:mm:ssZ. The times is in local time, depending on the timezone.
description str

Specifies the description of user. The maximum length is 255 characters.

disabled bool

Specifies whether the user is disabled. Defualts to false.

enable_change_password bool

Specifies whether to allow password modification. Defualts to true.

name str

Specifies the user name.

  • Pure numeric: the valid length is between 1 and 20.
  • Non-pure numeric: the name can contain 1 to 20 characters, only letters, digits, hyphens (-), underscore (_) and dots (.) are allowed. The name must start with a letter.
next_login_change_password bool

Specifies whether the next login requires a password reset. Defualts to true.

password_never_expires bool

Specifies whether the password will never expires. Defualts to false.

region str

The region in which to create the Workspace user resource. If omitted, the provider-level region will be used. Changing this will create a new resource.

email String

Specifies the email address of user. The value can contain 1 to 64 characters.

accountExpires String

Specifies the user's valid period configuration.

  • Never expires: 0.
  • Expires at a certain time: account expires must in RFC3339 format like yyyy-MM-ddTHH:mm:ssZ. The times is in local time, depending on the timezone.
description String

Specifies the description of user. The maximum length is 255 characters.

disabled Boolean

Specifies whether the user is disabled. Defualts to false.

enableChangePassword Boolean

Specifies whether to allow password modification. Defualts to true.

name String

Specifies the user name.

  • Pure numeric: the valid length is between 1 and 20.
  • Non-pure numeric: the name can contain 1 to 20 characters, only letters, digits, hyphens (-), underscore (_) and dots (.) are allowed. The name must start with a letter.
nextLoginChangePassword Boolean

Specifies whether the next login requires a password reset. Defualts to true.

passwordNeverExpires Boolean

Specifies whether the password will never expires. Defualts to false.

region String

The region in which to create the Workspace user resource. If omitted, the provider-level region will be used. Changing this will create a new resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the User resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Locked bool

Whether the user is locked.

TotalDesktops int

The number of desktops the user has.

Id string

The provider-assigned unique ID for this managed resource.

Locked bool

Whether the user is locked.

TotalDesktops int

The number of desktops the user has.

id String

The provider-assigned unique ID for this managed resource.

locked Boolean

Whether the user is locked.

totalDesktops Integer

The number of desktops the user has.

id string

The provider-assigned unique ID for this managed resource.

locked boolean

Whether the user is locked.

totalDesktops number

The number of desktops the user has.

id str

The provider-assigned unique ID for this managed resource.

locked bool

Whether the user is locked.

total_desktops int

The number of desktops the user has.

id String

The provider-assigned unique ID for this managed resource.

locked Boolean

Whether the user is locked.

totalDesktops Number

The number of desktops the user has.

Look up Existing User Resource {#look-up}

Get an existing User resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: UserState, opts?: CustomResourceOptions): User
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_expires: Optional[str] = None,
        description: Optional[str] = None,
        disabled: Optional[bool] = None,
        email: Optional[str] = None,
        enable_change_password: Optional[bool] = None,
        locked: Optional[bool] = None,
        name: Optional[str] = None,
        next_login_change_password: Optional[bool] = None,
        password_never_expires: Optional[bool] = None,
        region: Optional[str] = None,
        total_desktops: Optional[int] = None) -> User
func GetUser(ctx *Context, name string, id IDInput, state *UserState, opts ...ResourceOption) (*User, error)
public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)
public static User get(String name, Output<String> id, UserState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AccountExpires string

Specifies the user's valid period configuration.

  • Never expires: 0.
  • Expires at a certain time: account expires must in RFC3339 format like yyyy-MM-ddTHH:mm:ssZ. The times is in local time, depending on the timezone.
Description string

Specifies the description of user. The maximum length is 255 characters.

Disabled bool

Specifies whether the user is disabled. Defualts to false.

Email string

Specifies the email address of user. The value can contain 1 to 64 characters.

EnableChangePassword bool

Specifies whether to allow password modification. Defualts to true.

Locked bool

Whether the user is locked.

Name string

Specifies the user name.

  • Pure numeric: the valid length is between 1 and 20.
  • Non-pure numeric: the name can contain 1 to 20 characters, only letters, digits, hyphens (-), underscore (_) and dots (.) are allowed. The name must start with a letter.
NextLoginChangePassword bool

Specifies whether the next login requires a password reset. Defualts to true.

PasswordNeverExpires bool

Specifies whether the password will never expires. Defualts to false.

Region string

The region in which to create the Workspace user resource. If omitted, the provider-level region will be used. Changing this will create a new resource.

TotalDesktops int

The number of desktops the user has.

AccountExpires string

Specifies the user's valid period configuration.

  • Never expires: 0.
  • Expires at a certain time: account expires must in RFC3339 format like yyyy-MM-ddTHH:mm:ssZ. The times is in local time, depending on the timezone.
Description string

Specifies the description of user. The maximum length is 255 characters.

Disabled bool

Specifies whether the user is disabled. Defualts to false.

Email string

Specifies the email address of user. The value can contain 1 to 64 characters.

EnableChangePassword bool

Specifies whether to allow password modification. Defualts to true.

Locked bool

Whether the user is locked.

Name string

Specifies the user name.

  • Pure numeric: the valid length is between 1 and 20.
  • Non-pure numeric: the name can contain 1 to 20 characters, only letters, digits, hyphens (-), underscore (_) and dots (.) are allowed. The name must start with a letter.
NextLoginChangePassword bool

Specifies whether the next login requires a password reset. Defualts to true.

PasswordNeverExpires bool

Specifies whether the password will never expires. Defualts to false.

Region string

The region in which to create the Workspace user resource. If omitted, the provider-level region will be used. Changing this will create a new resource.

TotalDesktops int

The number of desktops the user has.

accountExpires String

Specifies the user's valid period configuration.

  • Never expires: 0.
  • Expires at a certain time: account expires must in RFC3339 format like yyyy-MM-ddTHH:mm:ssZ. The times is in local time, depending on the timezone.
description String

Specifies the description of user. The maximum length is 255 characters.

disabled Boolean

Specifies whether the user is disabled. Defualts to false.

email String

Specifies the email address of user. The value can contain 1 to 64 characters.

enableChangePassword Boolean

Specifies whether to allow password modification. Defualts to true.

locked Boolean

Whether the user is locked.

name String

Specifies the user name.

  • Pure numeric: the valid length is between 1 and 20.
  • Non-pure numeric: the name can contain 1 to 20 characters, only letters, digits, hyphens (-), underscore (_) and dots (.) are allowed. The name must start with a letter.
nextLoginChangePassword Boolean

Specifies whether the next login requires a password reset. Defualts to true.

passwordNeverExpires Boolean

Specifies whether the password will never expires. Defualts to false.

region String

The region in which to create the Workspace user resource. If omitted, the provider-level region will be used. Changing this will create a new resource.

totalDesktops Integer

The number of desktops the user has.

accountExpires string

Specifies the user's valid period configuration.

  • Never expires: 0.
  • Expires at a certain time: account expires must in RFC3339 format like yyyy-MM-ddTHH:mm:ssZ. The times is in local time, depending on the timezone.
description string

Specifies the description of user. The maximum length is 255 characters.

disabled boolean

Specifies whether the user is disabled. Defualts to false.

email string

Specifies the email address of user. The value can contain 1 to 64 characters.

enableChangePassword boolean

Specifies whether to allow password modification. Defualts to true.

locked boolean

Whether the user is locked.

name string

Specifies the user name.

  • Pure numeric: the valid length is between 1 and 20.
  • Non-pure numeric: the name can contain 1 to 20 characters, only letters, digits, hyphens (-), underscore (_) and dots (.) are allowed. The name must start with a letter.
nextLoginChangePassword boolean

Specifies whether the next login requires a password reset. Defualts to true.

passwordNeverExpires boolean

Specifies whether the password will never expires. Defualts to false.

region string

The region in which to create the Workspace user resource. If omitted, the provider-level region will be used. Changing this will create a new resource.

totalDesktops number

The number of desktops the user has.

account_expires str

Specifies the user's valid period configuration.

  • Never expires: 0.
  • Expires at a certain time: account expires must in RFC3339 format like yyyy-MM-ddTHH:mm:ssZ. The times is in local time, depending on the timezone.
description str

Specifies the description of user. The maximum length is 255 characters.

disabled bool

Specifies whether the user is disabled. Defualts to false.

email str

Specifies the email address of user. The value can contain 1 to 64 characters.

enable_change_password bool

Specifies whether to allow password modification. Defualts to true.

locked bool

Whether the user is locked.

name str

Specifies the user name.

  • Pure numeric: the valid length is between 1 and 20.
  • Non-pure numeric: the name can contain 1 to 20 characters, only letters, digits, hyphens (-), underscore (_) and dots (.) are allowed. The name must start with a letter.
next_login_change_password bool

Specifies whether the next login requires a password reset. Defualts to true.

password_never_expires bool

Specifies whether the password will never expires. Defualts to false.

region str

The region in which to create the Workspace user resource. If omitted, the provider-level region will be used. Changing this will create a new resource.

total_desktops int

The number of desktops the user has.

accountExpires String

Specifies the user's valid period configuration.

  • Never expires: 0.
  • Expires at a certain time: account expires must in RFC3339 format like yyyy-MM-ddTHH:mm:ssZ. The times is in local time, depending on the timezone.
description String

Specifies the description of user. The maximum length is 255 characters.

disabled Boolean

Specifies whether the user is disabled. Defualts to false.

email String

Specifies the email address of user. The value can contain 1 to 64 characters.

enableChangePassword Boolean

Specifies whether to allow password modification. Defualts to true.

locked Boolean

Whether the user is locked.

name String

Specifies the user name.

  • Pure numeric: the valid length is between 1 and 20.
  • Non-pure numeric: the name can contain 1 to 20 characters, only letters, digits, hyphens (-), underscore (_) and dots (.) are allowed. The name must start with a letter.
nextLoginChangePassword Boolean

Specifies whether the next login requires a password reset. Defualts to true.

passwordNeverExpires Boolean

Specifies whether the password will never expires. Defualts to false.

region String

The region in which to create the Workspace user resource. If omitted, the provider-level region will be used. Changing this will create a new resource.

totalDesktops Number

The number of desktops the user has.

Import

Users can be imported using the id, e.g.

 $ pulumi import huaweicloud:Workspace/user:User test a96e632a399d452eb29e5091e0af806a

Package Details

Repository
https://github.com/huaweicloud/pulumi-huaweicloud
License
Apache-2.0
Notes

This Pulumi package is based on the huaweicloud Terraform Provider.