@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
156 lines • 8.73 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.AmiCopy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* The "AMI copy" resource allows duplication of an Amazon Machine Image (AMI),
* including cross-region copies.
*
* If the source AMI has associated EBS snapshots, those will also be duplicated
* along with the AMI.
*
* This is useful for taking a single AMI provisioned in one region and making
* it available in another for a multi-region deployment.
*
* Copying an AMI can take several minutes. The creation of this resource will
* block until the new AMI is available for use on new instances.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.ec2.AmiCopy("example", {
* name: "example",
* sourceAmiId: "ami-xxxxxxxx",
* sourceAmiRegion: "us-west-1",
* tags: {
* Name: "HelloWorld",
* },
* });
* ```
*/
class AmiCopy extends pulumi.CustomResource {
/**
* Get an existing AmiCopy 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 AmiCopy(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AmiCopy. 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'] === AmiCopy.__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["destinationOutpostArn"] = state ? state.destinationOutpostArn : undefined;
resourceInputs["ebsBlockDevices"] = state ? state.ebsBlockDevices : undefined;
resourceInputs["enaSupport"] = state ? state.enaSupport : undefined;
resourceInputs["encrypted"] = state ? state.encrypted : 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["kmsKeyId"] = state ? state.kmsKeyId : 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["sourceAmiId"] = state ? state.sourceAmiId : undefined;
resourceInputs["sourceAmiRegion"] = state ? state.sourceAmiRegion : 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.sourceAmiId === undefined) && !opts.urn) {
throw new Error("Missing required property 'sourceAmiId'");
}
if ((!args || args.sourceAmiRegion === undefined) && !opts.urn) {
throw new Error("Missing required property 'sourceAmiRegion'");
}
resourceInputs["deprecationTime"] = args ? args.deprecationTime : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["destinationOutpostArn"] = args ? args.destinationOutpostArn : undefined;
resourceInputs["ebsBlockDevices"] = args ? args.ebsBlockDevices : undefined;
resourceInputs["encrypted"] = args ? args.encrypted : undefined;
resourceInputs["ephemeralBlockDevices"] = args ? args.ephemeralBlockDevices : undefined;
resourceInputs["kmsKeyId"] = args ? args.kmsKeyId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["sourceAmiId"] = args ? args.sourceAmiId : undefined;
resourceInputs["sourceAmiRegion"] = args ? args.sourceAmiRegion : 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(AmiCopy.__pulumiType, name, resourceInputs, opts);
}
}
exports.AmiCopy = AmiCopy;
/** @internal */
AmiCopy.__pulumiType = 'aws:ec2/amiCopy:AmiCopy';
//# sourceMappingURL=amiCopy.js.map