UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

151 lines • 8.06 kB
"use strict"; // *** 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, Object.assign(Object.assign({}, 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 ? 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["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; resourceInputs["architecture"] = args ? args.architecture : undefined; resourceInputs["bootMode"] = args ? args.bootMode : undefined; resourceInputs["deprecationTime"] = args ? args.deprecationTime : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["ebsBlockDevices"] = args ? args.ebsBlockDevices : undefined; resourceInputs["enaSupport"] = args ? args.enaSupport : undefined; resourceInputs["ephemeralBlockDevices"] = args ? args.ephemeralBlockDevices : undefined; resourceInputs["imageLocation"] = args ? args.imageLocation : undefined; resourceInputs["imdsSupport"] = args ? args.imdsSupport : undefined; resourceInputs["kernelId"] = args ? args.kernelId : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["ramdiskId"] = args ? args.ramdiskId : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["rootDeviceName"] = args ? args.rootDeviceName : undefined; resourceInputs["sriovNetSupport"] = args ? args.sriovNetSupport : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["tpmSupport"] = args ? args.tpmSupport : undefined; resourceInputs["uefiData"] = args ? args.uefiData : undefined; resourceInputs["virtualizationType"] = args ? args.virtualizationType : undefined; 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