@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
156 lines • 7.76 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, { ...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?.architecture;
resourceInputs["arn"] = state?.arn;
resourceInputs["bootMode"] = state?.bootMode;
resourceInputs["deprecationTime"] = state?.deprecationTime;
resourceInputs["description"] = state?.description;
resourceInputs["destinationOutpostArn"] = state?.destinationOutpostArn;
resourceInputs["ebsBlockDevices"] = state?.ebsBlockDevices;
resourceInputs["enaSupport"] = state?.enaSupport;
resourceInputs["encrypted"] = state?.encrypted;
resourceInputs["ephemeralBlockDevices"] = state?.ephemeralBlockDevices;
resourceInputs["hypervisor"] = state?.hypervisor;
resourceInputs["imageLocation"] = state?.imageLocation;
resourceInputs["imageOwnerAlias"] = state?.imageOwnerAlias;
resourceInputs["imageType"] = state?.imageType;
resourceInputs["imdsSupport"] = state?.imdsSupport;
resourceInputs["kernelId"] = state?.kernelId;
resourceInputs["kmsKeyId"] = state?.kmsKeyId;
resourceInputs["lastLaunchedTime"] = state?.lastLaunchedTime;
resourceInputs["manageEbsSnapshots"] = state?.manageEbsSnapshots;
resourceInputs["name"] = state?.name;
resourceInputs["ownerId"] = state?.ownerId;
resourceInputs["platform"] = state?.platform;
resourceInputs["platformDetails"] = state?.platformDetails;
resourceInputs["public"] = state?.public;
resourceInputs["ramdiskId"] = state?.ramdiskId;
resourceInputs["region"] = state?.region;
resourceInputs["rootDeviceName"] = state?.rootDeviceName;
resourceInputs["rootSnapshotId"] = state?.rootSnapshotId;
resourceInputs["sourceAmiId"] = state?.sourceAmiId;
resourceInputs["sourceAmiRegion"] = state?.sourceAmiRegion;
resourceInputs["sriovNetSupport"] = state?.sriovNetSupport;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["tpmSupport"] = state?.tpmSupport;
resourceInputs["uefiData"] = state?.uefiData;
resourceInputs["usageOperation"] = state?.usageOperation;
resourceInputs["virtualizationType"] = state?.virtualizationType;
}
else {
const args = argsOrState;
if (args?.sourceAmiId === undefined && !opts.urn) {
throw new Error("Missing required property 'sourceAmiId'");
}
if (args?.sourceAmiRegion === undefined && !opts.urn) {
throw new Error("Missing required property 'sourceAmiRegion'");
}
resourceInputs["deprecationTime"] = args?.deprecationTime;
resourceInputs["description"] = args?.description;
resourceInputs["destinationOutpostArn"] = args?.destinationOutpostArn;
resourceInputs["ebsBlockDevices"] = args?.ebsBlockDevices;
resourceInputs["encrypted"] = args?.encrypted;
resourceInputs["ephemeralBlockDevices"] = args?.ephemeralBlockDevices;
resourceInputs["kmsKeyId"] = args?.kmsKeyId;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["sourceAmiId"] = args?.sourceAmiId;
resourceInputs["sourceAmiRegion"] = args?.sourceAmiRegion;
resourceInputs["tags"] = args?.tags;
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