UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

142 lines 7.64 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.Desktop = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a Workspace desktop resource within HuaweiCloud. * * > **NOTE:** Before creating Workspace desktop, ensure that the Workspace service has been registered. * * ## Example Usage * * ## Import * * Desktops can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Workspace/desktop:Desktop test 339d2539-e945-4090-a08d-c16badc0c6bb * ``` * * Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response. The missing attributes include`user_email`, `delete_user`, `image_type`, `vpc_id`, `power_action`, `power_action_type` and `email_notification`. It is generally recommended running `terraform plan` after importing a desktop. You can then decide if changes should be applied to the desktop, or the resource definition should be updated to align with the desktop. Also you can ignore changes as below. hcl resource "huaweicloud_workspace_desktop" "test" { * * ... * * lifecycle { * * ignore_changes = [ * * user_email, delete_user, image_type, vpc_id, power_action, power_action_type, email_notification, * * ] * * } } */ class Desktop extends pulumi.CustomResource { /** * Get an existing Desktop 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 Desktop(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Desktop. 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'] === Desktop.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["availabilityZone"] = state ? state.availabilityZone : undefined; resourceInputs["dataVolumes"] = state ? state.dataVolumes : undefined; resourceInputs["deleteUser"] = state ? state.deleteUser : undefined; resourceInputs["emailNotification"] = state ? state.emailNotification : undefined; resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined; resourceInputs["flavorId"] = state ? state.flavorId : undefined; resourceInputs["imageId"] = state ? state.imageId : undefined; resourceInputs["imageType"] = state ? state.imageType : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["nics"] = state ? state.nics : undefined; resourceInputs["powerAction"] = state ? state.powerAction : undefined; resourceInputs["powerActionType"] = state ? state.powerActionType : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["rootVolume"] = state ? state.rootVolume : undefined; resourceInputs["securityGroups"] = state ? state.securityGroups : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["userEmail"] = state ? state.userEmail : undefined; resourceInputs["userGroup"] = state ? state.userGroup : undefined; resourceInputs["userName"] = state ? state.userName : undefined; resourceInputs["vpcId"] = state ? state.vpcId : undefined; } else { const args = argsOrState; if ((!args || args.flavorId === undefined) && !opts.urn) { throw new Error("Missing required property 'flavorId'"); } if ((!args || args.imageId === undefined) && !opts.urn) { throw new Error("Missing required property 'imageId'"); } if ((!args || args.imageType === undefined) && !opts.urn) { throw new Error("Missing required property 'imageType'"); } if ((!args || args.rootVolume === undefined) && !opts.urn) { throw new Error("Missing required property 'rootVolume'"); } if ((!args || args.userEmail === undefined) && !opts.urn) { throw new Error("Missing required property 'userEmail'"); } if ((!args || args.userGroup === undefined) && !opts.urn) { throw new Error("Missing required property 'userGroup'"); } if ((!args || args.userName === undefined) && !opts.urn) { throw new Error("Missing required property 'userName'"); } if ((!args || args.vpcId === undefined) && !opts.urn) { throw new Error("Missing required property 'vpcId'"); } resourceInputs["availabilityZone"] = args ? args.availabilityZone : undefined; resourceInputs["dataVolumes"] = args ? args.dataVolumes : undefined; resourceInputs["deleteUser"] = args ? args.deleteUser : undefined; resourceInputs["emailNotification"] = args ? args.emailNotification : undefined; resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined; resourceInputs["flavorId"] = args ? args.flavorId : undefined; resourceInputs["imageId"] = args ? args.imageId : undefined; resourceInputs["imageType"] = args ? args.imageType : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["nics"] = args ? args.nics : undefined; resourceInputs["powerAction"] = args ? args.powerAction : undefined; resourceInputs["powerActionType"] = args ? args.powerActionType : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["rootVolume"] = args ? args.rootVolume : undefined; resourceInputs["securityGroups"] = args ? args.securityGroups : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["userEmail"] = args ? args.userEmail : undefined; resourceInputs["userGroup"] = args ? args.userGroup : undefined; resourceInputs["userName"] = args ? args.userName : undefined; resourceInputs["vpcId"] = args ? args.vpcId : undefined; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Desktop.__pulumiType, name, resourceInputs, opts); } } exports.Desktop = Desktop; /** @internal */ Desktop.__pulumiType = 'huaweicloud:Workspace/desktop:Desktop'; //# sourceMappingURL=desktop.js.map