UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

120 lines 5.54 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 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, * * ] * * } } */ 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["accountExpires"] = state ? state.accountExpires : undefined; resourceInputs["activeType"] = state ? state.activeType : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["disabled"] = state ? state.disabled : undefined; resourceInputs["email"] = state ? state.email : undefined; resourceInputs["enableChangePassword"] = state ? state.enableChangePassword : undefined; resourceInputs["locked"] = state ? state.locked : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["nextLoginChangePassword"] = state ? state.nextLoginChangePassword : undefined; resourceInputs["password"] = state ? state.password : undefined; resourceInputs["passwordNeverExpires"] = state ? state.passwordNeverExpires : undefined; resourceInputs["phone"] = state ? state.phone : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["totalDesktops"] = state ? state.totalDesktops : undefined; } else { const args = argsOrState; resourceInputs["accountExpires"] = args ? args.accountExpires : undefined; resourceInputs["activeType"] = args ? args.activeType : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["disabled"] = args ? args.disabled : undefined; resourceInputs["email"] = args ? args.email : undefined; resourceInputs["enableChangePassword"] = args ? args.enableChangePassword : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["nextLoginChangePassword"] = args ? args.nextLoginChangePassword : undefined; resourceInputs["password"] = args ? args.password : undefined; resourceInputs["passwordNeverExpires"] = args ? args.passwordNeverExpires : undefined; resourceInputs["phone"] = args ? args.phone : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["locked"] = undefined /*out*/; resourceInputs["totalDesktops"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(User.__pulumiType, name, resourceInputs, opts); } } exports.User = User; /** @internal */ User.__pulumiType = 'huaweicloud:Workspace/user:User'; //# sourceMappingURL=user.js.map