@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
149 lines • 8.56 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.AmiFromInstance = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* The "AMI from instance" resource allows the creation of an Amazon Machine
* Image (AMI) modeled after an existing EBS-backed EC2 instance.
*
* The created AMI will refer to implicitly-created snapshots of the instance's
* EBS volumes and mimick its assigned block device configuration at the time
* the resource is created.
*
* This resource is best applied to an instance that is stopped when this instance
* is created, so that the contents of the created image are predictable. When
* applied to an instance that is running, *the instance will be stopped before taking
* the snapshots and then started back up again*, resulting in a period of
* downtime.
*
* Note that the source instance is inspected only at the initial creation of this
* resource. Ongoing updates to the referenced instance will not be propagated into
* the generated AMI. Users may taint or otherwise recreate the resource in order
* to produce a fresh snapshot.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.ec2.AmiFromInstance("example", {
* name: "example",
* sourceInstanceId: "i-xxxxxxxx",
* });
* ```
*/
class AmiFromInstance extends pulumi.CustomResource {
/**
* Get an existing AmiFromInstance 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 AmiFromInstance(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AmiFromInstance. 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'] === AmiFromInstance.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["architecture"] = state ? state.architecture : undefined;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["bootMode"] = state ? state.bootMode : undefined;
resourceInputs["deprecationTime"] = state ? state.deprecationTime : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["ebsBlockDevices"] = state ? state.ebsBlockDevices : undefined;
resourceInputs["enaSupport"] = state ? state.enaSupport : undefined;
resourceInputs["ephemeralBlockDevices"] = state ? state.ephemeralBlockDevices : undefined;
resourceInputs["hypervisor"] = state ? state.hypervisor : undefined;
resourceInputs["imageLocation"] = state ? state.imageLocation : undefined;
resourceInputs["imageOwnerAlias"] = state ? state.imageOwnerAlias : undefined;
resourceInputs["imageType"] = state ? state.imageType : undefined;
resourceInputs["imdsSupport"] = state ? state.imdsSupport : undefined;
resourceInputs["kernelId"] = state ? state.kernelId : undefined;
resourceInputs["lastLaunchedTime"] = state ? state.lastLaunchedTime : undefined;
resourceInputs["manageEbsSnapshots"] = state ? state.manageEbsSnapshots : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["ownerId"] = state ? state.ownerId : undefined;
resourceInputs["platform"] = state ? state.platform : undefined;
resourceInputs["platformDetails"] = state ? state.platformDetails : undefined;
resourceInputs["public"] = state ? state.public : undefined;
resourceInputs["ramdiskId"] = state ? state.ramdiskId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["rootDeviceName"] = state ? state.rootDeviceName : undefined;
resourceInputs["rootSnapshotId"] = state ? state.rootSnapshotId : undefined;
resourceInputs["snapshotWithoutReboot"] = state ? state.snapshotWithoutReboot : undefined;
resourceInputs["sourceInstanceId"] = state ? state.sourceInstanceId : undefined;
resourceInputs["sriovNetSupport"] = state ? state.sriovNetSupport : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["tpmSupport"] = state ? state.tpmSupport : undefined;
resourceInputs["uefiData"] = state ? state.uefiData : undefined;
resourceInputs["usageOperation"] = state ? state.usageOperation : undefined;
resourceInputs["virtualizationType"] = state ? state.virtualizationType : undefined;
}
else {
const args = argsOrState;
if ((!args || args.sourceInstanceId === undefined) && !opts.urn) {
throw new Error("Missing required property 'sourceInstanceId'");
}
resourceInputs["deprecationTime"] = args ? args.deprecationTime : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["ebsBlockDevices"] = args ? args.ebsBlockDevices : undefined;
resourceInputs["ephemeralBlockDevices"] = args ? args.ephemeralBlockDevices : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["snapshotWithoutReboot"] = args ? args.snapshotWithoutReboot : undefined;
resourceInputs["sourceInstanceId"] = args ? args.sourceInstanceId : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["architecture"] = undefined /*out*/;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["bootMode"] = undefined /*out*/;
resourceInputs["enaSupport"] = undefined /*out*/;
resourceInputs["hypervisor"] = undefined /*out*/;
resourceInputs["imageLocation"] = undefined /*out*/;
resourceInputs["imageOwnerAlias"] = undefined /*out*/;
resourceInputs["imageType"] = undefined /*out*/;
resourceInputs["imdsSupport"] = undefined /*out*/;
resourceInputs["kernelId"] = undefined /*out*/;
resourceInputs["lastLaunchedTime"] = undefined /*out*/;
resourceInputs["manageEbsSnapshots"] = undefined /*out*/;
resourceInputs["ownerId"] = undefined /*out*/;
resourceInputs["platform"] = undefined /*out*/;
resourceInputs["platformDetails"] = undefined /*out*/;
resourceInputs["public"] = undefined /*out*/;
resourceInputs["ramdiskId"] = undefined /*out*/;
resourceInputs["rootDeviceName"] = undefined /*out*/;
resourceInputs["rootSnapshotId"] = undefined /*out*/;
resourceInputs["sriovNetSupport"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["tpmSupport"] = undefined /*out*/;
resourceInputs["uefiData"] = undefined /*out*/;
resourceInputs["usageOperation"] = undefined /*out*/;
resourceInputs["virtualizationType"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AmiFromInstance.__pulumiType, name, resourceInputs, opts);
}
}
exports.AmiFromInstance = AmiFromInstance;
/** @internal */
AmiFromInstance.__pulumiType = 'aws:ec2/amiFromInstance:AmiFromInstance';
//# sourceMappingURL=amiFromInstance.js.map