UNPKG

@pulumi/aws

Version:

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

135 lines 7.13 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.LaunchConfiguration = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to create a new launch configuration, used for autoscaling groups. * * !> **WARNING:** The use of launch configurations is discouraged in favor of launch templates. Read more in the [AWS EC2 Documentation](https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-configurations.html). * * > **Note** When using `aws.ec2.LaunchConfiguration` with `aws.autoscaling.Group`, it is recommended to use the `namePrefix` (Optional) instead of the `name` (Optional) attribute. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const ubuntu = aws.ec2.getAmi({ * mostRecent: true, * filters: [ * { * name: "name", * values: ["ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-*"], * }, * { * name: "virtualization-type", * values: ["hvm"], * }, * ], * owners: ["099720109477"], * }); * const asConf = new aws.ec2.LaunchConfiguration("as_conf", { * name: "web_config", * imageId: ubuntu.then(ubuntu => ubuntu.id), * instanceType: "t2.micro", * }); * ``` * * ## Import * * Using `pulumi import`, import launch configurations using the `name`. For example: * * ```sh * $ pulumi import aws:ec2/launchConfiguration:LaunchConfiguration as_conf pulumi-lg-123456 * ``` */ class LaunchConfiguration extends pulumi.CustomResource { /** * Get an existing LaunchConfiguration 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 LaunchConfiguration(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of LaunchConfiguration. 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'] === LaunchConfiguration.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["associatePublicIpAddress"] = state ? state.associatePublicIpAddress : undefined; resourceInputs["ebsBlockDevices"] = state ? state.ebsBlockDevices : undefined; resourceInputs["ebsOptimized"] = state ? state.ebsOptimized : undefined; resourceInputs["enableMonitoring"] = state ? state.enableMonitoring : undefined; resourceInputs["ephemeralBlockDevices"] = state ? state.ephemeralBlockDevices : undefined; resourceInputs["iamInstanceProfile"] = state ? state.iamInstanceProfile : undefined; resourceInputs["imageId"] = state ? state.imageId : undefined; resourceInputs["instanceType"] = state ? state.instanceType : undefined; resourceInputs["keyName"] = state ? state.keyName : undefined; resourceInputs["metadataOptions"] = state ? state.metadataOptions : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["namePrefix"] = state ? state.namePrefix : undefined; resourceInputs["placementTenancy"] = state ? state.placementTenancy : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["rootBlockDevice"] = state ? state.rootBlockDevice : undefined; resourceInputs["securityGroups"] = state ? state.securityGroups : undefined; resourceInputs["spotPrice"] = state ? state.spotPrice : undefined; resourceInputs["userData"] = state ? state.userData : undefined; resourceInputs["userDataBase64"] = state ? state.userDataBase64 : undefined; } else { const args = argsOrState; if ((!args || args.imageId === undefined) && !opts.urn) { throw new Error("Missing required property 'imageId'"); } if ((!args || args.instanceType === undefined) && !opts.urn) { throw new Error("Missing required property 'instanceType'"); } resourceInputs["associatePublicIpAddress"] = args ? args.associatePublicIpAddress : undefined; resourceInputs["ebsBlockDevices"] = args ? args.ebsBlockDevices : undefined; resourceInputs["ebsOptimized"] = args ? args.ebsOptimized : undefined; resourceInputs["enableMonitoring"] = args ? args.enableMonitoring : undefined; resourceInputs["ephemeralBlockDevices"] = args ? args.ephemeralBlockDevices : undefined; resourceInputs["iamInstanceProfile"] = args ? args.iamInstanceProfile : undefined; resourceInputs["imageId"] = args ? args.imageId : undefined; resourceInputs["instanceType"] = args ? args.instanceType : undefined; resourceInputs["keyName"] = args ? args.keyName : undefined; resourceInputs["metadataOptions"] = args ? args.metadataOptions : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["namePrefix"] = args ? args.namePrefix : undefined; resourceInputs["placementTenancy"] = args ? args.placementTenancy : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["rootBlockDevice"] = args ? args.rootBlockDevice : undefined; resourceInputs["securityGroups"] = args ? args.securityGroups : undefined; resourceInputs["spotPrice"] = args ? args.spotPrice : undefined; resourceInputs["userData"] = args ? args.userData : undefined; resourceInputs["userDataBase64"] = args ? args.userDataBase64 : undefined; resourceInputs["arn"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(LaunchConfiguration.__pulumiType, name, resourceInputs, opts); } } exports.LaunchConfiguration = LaunchConfiguration; /** @internal */ LaunchConfiguration.__pulumiType = 'aws:ec2/launchConfiguration:LaunchConfiguration'; //# sourceMappingURL=launchConfiguration.js.map