@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
290 lines (289 loc) • 10.6 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages a Workspace user resource within HuaweiCloud.
*
* ## Example Usage
* ### Create a user that never expires
*
* ```typescript
* 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,
* });
* ```
*
* ## Import
*
* Users can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Workspace/user:User test <id>
* ```
*
* Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes include`password`. It is generally recommended running `terraform plan` after importing the resource. You can then decide if changes should be applied to the user, or the resource definition should be updated to align with the user. Also you can ignore changes as below. hcl resource "huaweicloud_workspace_user" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* password,
*
* ]
*
* } }
*/
export declare class User extends pulumi.CustomResource {
/**
* Get an existing User resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: UserState, opts?: pulumi.CustomResourceOptions): User;
/**
* Returns true if the given object is an instance of User. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is User;
/**
* Specifies the user's valid period configuration.
* Defaults to "0".
* + 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.
*/
readonly accountExpires: pulumi.Output<string | undefined>;
/**
* Specifies the activation mode of the user. Defaults to **USER_ACTIVATE**.
* The valid values are as follows:
* + **USER_ACTIVATE**: Activated by the user.
* + **ADMIN_ACTIVATE**: Activated by the administator.
*/
readonly activeType: pulumi.Output<string>;
/**
* Specifies the description of user. The maximum length is `255` characters.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* Specifies whether the user is disabled.
* Defaults to **false**.
*/
readonly disabled: pulumi.Output<boolean | undefined>;
/**
* Specifies the email address of user. The value can contain `1` to `64` characters.
*/
readonly email: pulumi.Output<string | undefined>;
/**
* Specifies whether to allow password modification.
* Defaults to **true**.
*/
readonly enableChangePassword: pulumi.Output<boolean | undefined>;
/**
* Whether the user is locked.
*/
readonly locked: pulumi.Output<boolean>;
/**
* 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.
*/
readonly name: pulumi.Output<string>;
/**
* Specifies whether the next login requires a password reset.
* Defaults to **true**.
*/
readonly nextLoginChangePassword: pulumi.Output<boolean | undefined>;
/**
* Specifies the initial passowrd of user.
* This parameter is available and required when `activeType` is set to **ADMIN_ACTIVATE**.
*/
readonly password: pulumi.Output<string | undefined>;
/**
* Specifies whether the password will never expires.
* Defaults to **false**.
*/
readonly passwordNeverExpires: pulumi.Output<boolean | undefined>;
/**
* Specifies the phone number of user.
*/
readonly phone: pulumi.Output<string | undefined>;
/**
* 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.
*/
readonly region: pulumi.Output<string>;
/**
* The number of desktops the user has.
*/
readonly totalDesktops: pulumi.Output<number>;
/**
* Create a User resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args?: UserArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering User resources.
*/
export interface UserState {
/**
* Specifies the user's valid period configuration.
* Defaults to "0".
* + 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.
*/
accountExpires?: pulumi.Input<string>;
/**
* Specifies the activation mode of the user. Defaults to **USER_ACTIVATE**.
* The valid values are as follows:
* + **USER_ACTIVATE**: Activated by the user.
* + **ADMIN_ACTIVATE**: Activated by the administator.
*/
activeType?: pulumi.Input<string>;
/**
* Specifies the description of user. The maximum length is `255` characters.
*/
description?: pulumi.Input<string>;
/**
* Specifies whether the user is disabled.
* Defaults to **false**.
*/
disabled?: pulumi.Input<boolean>;
/**
* Specifies the email address of user. The value can contain `1` to `64` characters.
*/
email?: pulumi.Input<string>;
/**
* Specifies whether to allow password modification.
* Defaults to **true**.
*/
enableChangePassword?: pulumi.Input<boolean>;
/**
* Whether the user is locked.
*/
locked?: pulumi.Input<boolean>;
/**
* 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.
*/
name?: pulumi.Input<string>;
/**
* Specifies whether the next login requires a password reset.
* Defaults to **true**.
*/
nextLoginChangePassword?: pulumi.Input<boolean>;
/**
* Specifies the initial passowrd of user.
* This parameter is available and required when `activeType` is set to **ADMIN_ACTIVATE**.
*/
password?: pulumi.Input<string>;
/**
* Specifies whether the password will never expires.
* Defaults to **false**.
*/
passwordNeverExpires?: pulumi.Input<boolean>;
/**
* Specifies the phone number of user.
*/
phone?: pulumi.Input<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.
*/
region?: pulumi.Input<string>;
/**
* The number of desktops the user has.
*/
totalDesktops?: pulumi.Input<number>;
}
/**
* The set of arguments for constructing a User resource.
*/
export interface UserArgs {
/**
* Specifies the user's valid period configuration.
* Defaults to "0".
* + 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.
*/
accountExpires?: pulumi.Input<string>;
/**
* Specifies the activation mode of the user. Defaults to **USER_ACTIVATE**.
* The valid values are as follows:
* + **USER_ACTIVATE**: Activated by the user.
* + **ADMIN_ACTIVATE**: Activated by the administator.
*/
activeType?: pulumi.Input<string>;
/**
* Specifies the description of user. The maximum length is `255` characters.
*/
description?: pulumi.Input<string>;
/**
* Specifies whether the user is disabled.
* Defaults to **false**.
*/
disabled?: pulumi.Input<boolean>;
/**
* Specifies the email address of user. The value can contain `1` to `64` characters.
*/
email?: pulumi.Input<string>;
/**
* Specifies whether to allow password modification.
* Defaults to **true**.
*/
enableChangePassword?: pulumi.Input<boolean>;
/**
* 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.
*/
name?: pulumi.Input<string>;
/**
* Specifies whether the next login requires a password reset.
* Defaults to **true**.
*/
nextLoginChangePassword?: pulumi.Input<boolean>;
/**
* Specifies the initial passowrd of user.
* This parameter is available and required when `activeType` is set to **ADMIN_ACTIVATE**.
*/
password?: pulumi.Input<string>;
/**
* Specifies whether the password will never expires.
* Defaults to **false**.
*/
passwordNeverExpires?: pulumi.Input<boolean>;
/**
* Specifies the phone number of user.
*/
phone?: pulumi.Input<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.
*/
region?: pulumi.Input<string>;
}