UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

118 lines 5.21 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.User = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * 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, * * ] * * } } */ 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, id, state, opts) { return new User(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === User.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessType"] = state ? state.accessType : undefined; resourceInputs["countryCode"] = state ? state.countryCode : undefined; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["email"] = state ? state.email : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["externalIdentityId"] = state ? state.externalIdentityId : undefined; resourceInputs["externalIdentityType"] = state ? state.externalIdentityType : undefined; resourceInputs["lastLogin"] = state ? state.lastLogin : undefined; resourceInputs["loginProtectVerificationMethod"] = state ? state.loginProtectVerificationMethod : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["password"] = state ? state.password : undefined; resourceInputs["passwordStrength"] = state ? state.passwordStrength : undefined; resourceInputs["phone"] = state ? state.phone : undefined; resourceInputs["pwdReset"] = state ? state.pwdReset : undefined; } else { const args = argsOrState; resourceInputs["accessType"] = args ? args.accessType : undefined; resourceInputs["countryCode"] = args ? args.countryCode : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["email"] = args ? args.email : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["externalIdentityId"] = args ? args.externalIdentityId : undefined; resourceInputs["externalIdentityType"] = args ? args.externalIdentityType : undefined; resourceInputs["loginProtectVerificationMethod"] = args ? args.loginProtectVerificationMethod : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["password"] = args ? args.password : undefined; resourceInputs["phone"] = args ? args.phone : undefined; resourceInputs["pwdReset"] = args ? args.pwdReset : undefined; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["lastLogin"] = undefined /*out*/; resourceInputs["passwordStrength"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(User.__pulumiType, name, resourceInputs, opts); } } exports.User = User; /** @internal */ User.__pulumiType = 'huaweicloud:Iam/user:User'; //# sourceMappingURL=user.js.map