UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

127 lines 6.06 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Workspace = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a workspace in [AWS Workspaces](https://docs.aws.amazon.com/workspaces/latest/adminguide/amazon-workspaces.html) Service * * > **NOTE:** AWS WorkSpaces service requires [`workspaces_DefaultRole`](https://docs.aws.amazon.com/workspaces/latest/adminguide/workspaces-access-control.html#create-default-role) IAM role to operate normally. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const valueWindows10 = aws.workspaces.getBundle({ * bundleId: "wsb-bh8rsxt14", * }); * const workspaces = aws.kms.getKey({ * keyId: "alias/aws/workspaces", * }); * const example = new aws.workspaces.Workspace("example", { * directoryId: exampleAwsWorkspacesDirectory.id, * bundleId: valueWindows10.then(valueWindows10 => valueWindows10.id), * userName: "john.doe", * rootVolumeEncryptionEnabled: true, * userVolumeEncryptionEnabled: true, * volumeEncryptionKey: workspaces.then(workspaces => workspaces.arn), * workspaceProperties: { * computeTypeName: "VALUE", * userVolumeSizeGib: 10, * rootVolumeSizeGib: 80, * runningMode: "AUTO_STOP", * runningModeAutoStopTimeoutInMinutes: 60, * }, * tags: { * Department: "IT", * }, * }); * ``` * * ## Import * * Using `pulumi import`, import Workspaces using their ID. For example: * * ```sh * $ pulumi import aws:workspaces/workspace:Workspace example ws-9z9zmbkhv * ``` */ class Workspace extends pulumi.CustomResource { /** * Get an existing Workspace 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 Workspace(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Workspace. 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'] === Workspace.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["bundleId"] = state ? state.bundleId : undefined; resourceInputs["computerName"] = state ? state.computerName : undefined; resourceInputs["directoryId"] = state ? state.directoryId : undefined; resourceInputs["ipAddress"] = state ? state.ipAddress : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["rootVolumeEncryptionEnabled"] = state ? state.rootVolumeEncryptionEnabled : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["userName"] = state ? state.userName : undefined; resourceInputs["userVolumeEncryptionEnabled"] = state ? state.userVolumeEncryptionEnabled : undefined; resourceInputs["volumeEncryptionKey"] = state ? state.volumeEncryptionKey : undefined; resourceInputs["workspaceProperties"] = state ? state.workspaceProperties : undefined; } else { const args = argsOrState; if ((!args || args.bundleId === undefined) && !opts.urn) { throw new Error("Missing required property 'bundleId'"); } if ((!args || args.directoryId === undefined) && !opts.urn) { throw new Error("Missing required property 'directoryId'"); } if ((!args || args.userName === undefined) && !opts.urn) { throw new Error("Missing required property 'userName'"); } resourceInputs["bundleId"] = args ? args.bundleId : undefined; resourceInputs["directoryId"] = args ? args.directoryId : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["rootVolumeEncryptionEnabled"] = args ? args.rootVolumeEncryptionEnabled : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["userName"] = args ? args.userName : undefined; resourceInputs["userVolumeEncryptionEnabled"] = args ? args.userVolumeEncryptionEnabled : undefined; resourceInputs["volumeEncryptionKey"] = args ? args.volumeEncryptionKey : undefined; resourceInputs["workspaceProperties"] = args ? args.workspaceProperties : undefined; resourceInputs["computerName"] = undefined /*out*/; resourceInputs["ipAddress"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Workspace.__pulumiType, name, resourceInputs, opts); } } exports.Workspace = Workspace; /** @internal */ Workspace.__pulumiType = 'aws:workspaces/workspace:Workspace'; //# sourceMappingURL=workspace.js.map