@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
151 lines • 7.08 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.Ami = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* The AMI resource allows the creation and management of a completely-custom
* *Amazon Machine Image* (AMI).
*
* If you just want to duplicate an existing AMI, possibly copying it to another
* region, it's better to use `aws.ec2.AmiCopy` instead.
*
* If you just want to share an existing AMI with another AWS account,
* it's better to use `aws.ec2.AmiLaunchPermission` instead.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* // Create an AMI that will start a machine whose root device is backed by
* // an EBS volume populated from a snapshot. We assume that such a snapshot
* // already exists with the id "snap-xxxxxxxx".
* const example = new aws.ec2.Ami("example", {
* name: "example",
* virtualizationType: "hvm",
* rootDeviceName: "/dev/xvda",
* imdsSupport: "v2.0",
* ebsBlockDevices: [{
* deviceName: "/dev/xvda",
* snapshotId: "snap-xxxxxxxx",
* volumeSize: 8,
* }],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import `aws_ami` using the ID of the AMI. For example:
*
* ```sh
* $ pulumi import aws:ec2/ami:Ami example ami-12345678
* ```
*/
class Ami extends pulumi.CustomResource {
/**
* Get an existing Ami 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 Ami(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Ami. 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'] === Ami.__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["ebsBlockDevices"] = state?.ebsBlockDevices;
resourceInputs["enaSupport"] = state?.enaSupport;
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["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["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;
resourceInputs["architecture"] = args?.architecture;
resourceInputs["bootMode"] = args?.bootMode;
resourceInputs["deprecationTime"] = args?.deprecationTime;
resourceInputs["description"] = args?.description;
resourceInputs["ebsBlockDevices"] = args?.ebsBlockDevices;
resourceInputs["enaSupport"] = args?.enaSupport;
resourceInputs["ephemeralBlockDevices"] = args?.ephemeralBlockDevices;
resourceInputs["imageLocation"] = args?.imageLocation;
resourceInputs["imdsSupport"] = args?.imdsSupport;
resourceInputs["kernelId"] = args?.kernelId;
resourceInputs["name"] = args?.name;
resourceInputs["ramdiskId"] = args?.ramdiskId;
resourceInputs["region"] = args?.region;
resourceInputs["rootDeviceName"] = args?.rootDeviceName;
resourceInputs["sriovNetSupport"] = args?.sriovNetSupport;
resourceInputs["tags"] = args?.tags;
resourceInputs["tpmSupport"] = args?.tpmSupport;
resourceInputs["uefiData"] = args?.uefiData;
resourceInputs["virtualizationType"] = args?.virtualizationType;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["hypervisor"] = undefined /*out*/;
resourceInputs["imageOwnerAlias"] = undefined /*out*/;
resourceInputs["imageType"] = 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["rootSnapshotId"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["usageOperation"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Ami.__pulumiType, name, resourceInputs, opts);
}
}
exports.Ami = Ami;
/** @internal */
Ami.__pulumiType = 'aws:ec2/ami:Ami';
//# sourceMappingURL=ami.js.map