@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
135 lines • 6.36 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.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, { ...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?.arn;
resourceInputs["associatePublicIpAddress"] = state?.associatePublicIpAddress;
resourceInputs["ebsBlockDevices"] = state?.ebsBlockDevices;
resourceInputs["ebsOptimized"] = state?.ebsOptimized;
resourceInputs["enableMonitoring"] = state?.enableMonitoring;
resourceInputs["ephemeralBlockDevices"] = state?.ephemeralBlockDevices;
resourceInputs["iamInstanceProfile"] = state?.iamInstanceProfile;
resourceInputs["imageId"] = state?.imageId;
resourceInputs["instanceType"] = state?.instanceType;
resourceInputs["keyName"] = state?.keyName;
resourceInputs["metadataOptions"] = state?.metadataOptions;
resourceInputs["name"] = state?.name;
resourceInputs["namePrefix"] = state?.namePrefix;
resourceInputs["placementTenancy"] = state?.placementTenancy;
resourceInputs["region"] = state?.region;
resourceInputs["rootBlockDevice"] = state?.rootBlockDevice;
resourceInputs["securityGroups"] = state?.securityGroups;
resourceInputs["spotPrice"] = state?.spotPrice;
resourceInputs["userData"] = state?.userData;
resourceInputs["userDataBase64"] = state?.userDataBase64;
}
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["associatePublicIpAddress"] = args?.associatePublicIpAddress;
resourceInputs["ebsBlockDevices"] = args?.ebsBlockDevices;
resourceInputs["ebsOptimized"] = args?.ebsOptimized;
resourceInputs["enableMonitoring"] = args?.enableMonitoring;
resourceInputs["ephemeralBlockDevices"] = args?.ephemeralBlockDevices;
resourceInputs["iamInstanceProfile"] = args?.iamInstanceProfile;
resourceInputs["imageId"] = args?.imageId;
resourceInputs["instanceType"] = args?.instanceType;
resourceInputs["keyName"] = args?.keyName;
resourceInputs["metadataOptions"] = args?.metadataOptions;
resourceInputs["name"] = args?.name;
resourceInputs["namePrefix"] = args?.namePrefix;
resourceInputs["placementTenancy"] = args?.placementTenancy;
resourceInputs["region"] = args?.region;
resourceInputs["rootBlockDevice"] = args?.rootBlockDevice;
resourceInputs["securityGroups"] = args?.securityGroups;
resourceInputs["spotPrice"] = args?.spotPrice;
resourceInputs["userData"] = args?.userData;
resourceInputs["userDataBase64"] = args?.userDataBase64;
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