UNPKG

@pulumi/aws

Version:

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

133 lines 5.35 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.EnvironmentEC2 = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a Cloud9 EC2 Development Environment. * * ## Example Usage * * Basic usage: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.cloud9.EnvironmentEC2("example", { * instanceType: "t2.micro", * name: "example-env", * imageId: "amazonlinux-2023-x86_64", * }); * ``` * * Get the URL of the Cloud9 environment after creation: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.cloud9.EnvironmentEC2("example", {instanceType: "t2.micro"}); * const cloud9Instance = aws.ec2.getInstanceOutput({ * filters: [{ * name: "tag:aws:cloud9:environment", * values: [example.id], * }], * }); * export const cloud9Url = pulumi.interpolate`https://${region}.console.aws.amazon.com/cloud9/ide/${example.id}`; * ``` * * Allocate a static IP to the Cloud9 environment: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.cloud9.EnvironmentEC2("example", {instanceType: "t2.micro"}); * const cloud9Instance = aws.ec2.getInstanceOutput({ * filters: [{ * name: "tag:aws:cloud9:environment", * values: [example.id], * }], * }); * const cloud9Eip = new aws.ec2.Eip("cloud9_eip", { * instance: cloud9Instance.apply(cloud9Instance => cloud9Instance.id), * domain: "vpc", * }); * export const cloud9PublicIp = cloud9Eip.publicIp; * ``` */ class EnvironmentEC2 extends pulumi.CustomResource { /** * Get an existing EnvironmentEC2 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 EnvironmentEC2(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of EnvironmentEC2. 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'] === EnvironmentEC2.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["automaticStopTimeMinutes"] = state?.automaticStopTimeMinutes; resourceInputs["connectionType"] = state?.connectionType; resourceInputs["description"] = state?.description; resourceInputs["imageId"] = state?.imageId; resourceInputs["instanceType"] = state?.instanceType; resourceInputs["name"] = state?.name; resourceInputs["ownerArn"] = state?.ownerArn; resourceInputs["region"] = state?.region; resourceInputs["subnetId"] = state?.subnetId; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["type"] = state?.type; } else { const args = argsOrState; if (args?.imageId === undefined && !opts.urn) { throw new Error("Missing required property 'imageId'"); } if (args?.instanceType === undefined && !opts.urn) { throw new Error("Missing required property 'instanceType'"); } resourceInputs["automaticStopTimeMinutes"] = args?.automaticStopTimeMinutes; resourceInputs["connectionType"] = args?.connectionType; resourceInputs["description"] = args?.description; resourceInputs["imageId"] = args?.imageId; resourceInputs["instanceType"] = args?.instanceType; resourceInputs["name"] = args?.name; resourceInputs["ownerArn"] = args?.ownerArn; resourceInputs["region"] = args?.region; resourceInputs["subnetId"] = args?.subnetId; resourceInputs["tags"] = args?.tags; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; resourceInputs["type"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(EnvironmentEC2.__pulumiType, name, resourceInputs, opts); } } exports.EnvironmentEC2 = EnvironmentEC2; /** @internal */ EnvironmentEC2.__pulumiType = 'aws:cloud9/environmentEC2:EnvironmentEC2'; //# sourceMappingURL=environmentEC2.js.map