@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
285 lines (284 loc) • 11 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages an IAM user resource within HuaweiCloud.
*
* > **NOTE:** You *must* have admin privileges to use this resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const user1Password = config.requireObject("user1Password");
* const user1 = new huaweicloud.iam.User("user1", {
* description: "A user",
* password: user1Password,
* });
* ```
*
* ## Import
*
* Users can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Iam/user:User user_1 89c60255-9bd6-460c-822a-e2b959ede9d2
* ```
*
* But due to the security reason, `password` can not be imported, you can ignore it as below. hcl resource "huaweicloud_identity_user" "user_1" {
*
* ...
*
* 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 access type of the user. Available values are:
* + **default**: support both programmatic and management console access.
* + **programmatic**: only support programmatic access.
* + **console**: only support management console access.
*/
readonly accessType: pulumi.Output<string>;
/**
* Specifies the country code. The country code of the Chinese mainland is 0086. This
* parameter must be used together with `phone`.
*/
readonly countryCode: pulumi.Output<string | undefined>;
/**
* The time when the IAM user was created.
*/
readonly createTime: pulumi.Output<string>;
/**
* Specifies the description of the user.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* Specifies the email address with a maximum of `255` characters.
*/
readonly email: pulumi.Output<string | undefined>;
/**
* Specifies whether the user is enabled or disabled. Valid values are **true** and **false**.
*/
readonly enabled: pulumi.Output<boolean | undefined>;
/**
* Specifies the ID of the IAM user in the external system.
* This parameter is used for IAM user SSO type, make sure that the **IAM_SAML_Attributes_xUserId** of the federated user
* is the same as the `externalIdentityId` of the corresponding IAM user.
*/
readonly externalIdentityId: pulumi.Output<string | undefined>;
/**
* Specifies the type of the IAM user in the external system.
* Only **TenantIdp** is supported now. This parameter must be used together with `externalIdentityId`.
*/
readonly externalIdentityType: pulumi.Output<string>;
/**
* The time when the IAM user last login.
*/
readonly lastLogin: pulumi.Output<string>;
/**
* Specifies the verification method of login protect. If it is
* empty, the login protection will be disabled.
*/
readonly loginProtectVerificationMethod: pulumi.Output<string | undefined>;
/**
* Specifies the name of the user. The user name consists of `1` to `32` characters. It can
* contain only uppercase letters, lowercase letters, digits, spaces, and special characters (-_) and cannot start with a
* digit.
*/
readonly name: pulumi.Output<string>;
/**
* Specifies the password for the user with `6` to `32` characters. It must contain at least
* two of the following character types: uppercase letters, lowercase letters, digits, and special characters.
*/
readonly password: pulumi.Output<string | undefined>;
/**
* Indicates the password strength.
*/
readonly passwordStrength: pulumi.Output<string>;
/**
* Specifies the mobile number with a maximum of `32` digits. This parameter must be used
* together with `countryCode`.
*/
readonly phone: pulumi.Output<string | undefined>;
/**
* Specifies whether or not the password should be reset. By default, the password is asked
* to reset at the first login.
*/
readonly pwdReset: pulumi.Output<boolean | undefined>;
/**
* 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 access type of the user. Available values are:
* + **default**: support both programmatic and management console access.
* + **programmatic**: only support programmatic access.
* + **console**: only support management console access.
*/
accessType?: pulumi.Input<string>;
/**
* Specifies the country code. The country code of the Chinese mainland is 0086. This
* parameter must be used together with `phone`.
*/
countryCode?: pulumi.Input<string>;
/**
* The time when the IAM user was created.
*/
createTime?: pulumi.Input<string>;
/**
* Specifies the description of the user.
*/
description?: pulumi.Input<string>;
/**
* Specifies the email address with a maximum of `255` characters.
*/
email?: pulumi.Input<string>;
/**
* Specifies whether the user is enabled or disabled. Valid values are **true** and **false**.
*/
enabled?: pulumi.Input<boolean>;
/**
* Specifies the ID of the IAM user in the external system.
* This parameter is used for IAM user SSO type, make sure that the **IAM_SAML_Attributes_xUserId** of the federated user
* is the same as the `externalIdentityId` of the corresponding IAM user.
*/
externalIdentityId?: pulumi.Input<string>;
/**
* Specifies the type of the IAM user in the external system.
* Only **TenantIdp** is supported now. This parameter must be used together with `externalIdentityId`.
*/
externalIdentityType?: pulumi.Input<string>;
/**
* The time when the IAM user last login.
*/
lastLogin?: pulumi.Input<string>;
/**
* Specifies the verification method of login protect. If it is
* empty, the login protection will be disabled.
*/
loginProtectVerificationMethod?: pulumi.Input<string>;
/**
* Specifies the name of the user. The user name consists of `1` to `32` characters. It can
* contain only uppercase letters, lowercase letters, digits, spaces, and special characters (-_) and cannot start with a
* digit.
*/
name?: pulumi.Input<string>;
/**
* Specifies the password for the user with `6` to `32` characters. It must contain at least
* two of the following character types: uppercase letters, lowercase letters, digits, and special characters.
*/
password?: pulumi.Input<string>;
/**
* Indicates the password strength.
*/
passwordStrength?: pulumi.Input<string>;
/**
* Specifies the mobile number with a maximum of `32` digits. This parameter must be used
* together with `countryCode`.
*/
phone?: pulumi.Input<string>;
/**
* Specifies whether or not the password should be reset. By default, the password is asked
* to reset at the first login.
*/
pwdReset?: pulumi.Input<boolean>;
}
/**
* The set of arguments for constructing a User resource.
*/
export interface UserArgs {
/**
* Specifies the access type of the user. Available values are:
* + **default**: support both programmatic and management console access.
* + **programmatic**: only support programmatic access.
* + **console**: only support management console access.
*/
accessType?: pulumi.Input<string>;
/**
* Specifies the country code. The country code of the Chinese mainland is 0086. This
* parameter must be used together with `phone`.
*/
countryCode?: pulumi.Input<string>;
/**
* Specifies the description of the user.
*/
description?: pulumi.Input<string>;
/**
* Specifies the email address with a maximum of `255` characters.
*/
email?: pulumi.Input<string>;
/**
* Specifies whether the user is enabled or disabled. Valid values are **true** and **false**.
*/
enabled?: pulumi.Input<boolean>;
/**
* Specifies the ID of the IAM user in the external system.
* This parameter is used for IAM user SSO type, make sure that the **IAM_SAML_Attributes_xUserId** of the federated user
* is the same as the `externalIdentityId` of the corresponding IAM user.
*/
externalIdentityId?: pulumi.Input<string>;
/**
* Specifies the type of the IAM user in the external system.
* Only **TenantIdp** is supported now. This parameter must be used together with `externalIdentityId`.
*/
externalIdentityType?: pulumi.Input<string>;
/**
* Specifies the verification method of login protect. If it is
* empty, the login protection will be disabled.
*/
loginProtectVerificationMethod?: pulumi.Input<string>;
/**
* Specifies the name of the user. The user name consists of `1` to `32` characters. It can
* contain only uppercase letters, lowercase letters, digits, spaces, and special characters (-_) and cannot start with a
* digit.
*/
name?: pulumi.Input<string>;
/**
* Specifies the password for the user with `6` to `32` characters. It must contain at least
* two of the following character types: uppercase letters, lowercase letters, digits, and special characters.
*/
password?: pulumi.Input<string>;
/**
* Specifies the mobile number with a maximum of `32` digits. This parameter must be used
* together with `countryCode`.
*/
phone?: pulumi.Input<string>;
/**
* Specifies whether or not the password should be reset. By default, the password is asked
* to reset at the first login.
*/
pwdReset?: pulumi.Input<boolean>;
}