@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
127 lines • 5.59 kB
JavaScript
// *** 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, { ...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?.bundleId;
resourceInputs["computerName"] = state?.computerName;
resourceInputs["directoryId"] = state?.directoryId;
resourceInputs["ipAddress"] = state?.ipAddress;
resourceInputs["region"] = state?.region;
resourceInputs["rootVolumeEncryptionEnabled"] = state?.rootVolumeEncryptionEnabled;
resourceInputs["state"] = state?.state;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["userName"] = state?.userName;
resourceInputs["userVolumeEncryptionEnabled"] = state?.userVolumeEncryptionEnabled;
resourceInputs["volumeEncryptionKey"] = state?.volumeEncryptionKey;
resourceInputs["workspaceProperties"] = state?.workspaceProperties;
}
else {
const args = argsOrState;
if (args?.bundleId === undefined && !opts.urn) {
throw new Error("Missing required property 'bundleId'");
}
if (args?.directoryId === undefined && !opts.urn) {
throw new Error("Missing required property 'directoryId'");
}
if (args?.userName === undefined && !opts.urn) {
throw new Error("Missing required property 'userName'");
}
resourceInputs["bundleId"] = args?.bundleId;
resourceInputs["directoryId"] = args?.directoryId;
resourceInputs["region"] = args?.region;
resourceInputs["rootVolumeEncryptionEnabled"] = args?.rootVolumeEncryptionEnabled;
resourceInputs["tags"] = args?.tags;
resourceInputs["userName"] = args?.userName;
resourceInputs["userVolumeEncryptionEnabled"] = args?.userVolumeEncryptionEnabled;
resourceInputs["volumeEncryptionKey"] = args?.volumeEncryptionKey;
resourceInputs["workspaceProperties"] = args?.workspaceProperties;
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
;