@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
141 lines • 5.85 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.ImageRecipe = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an Image Builder Image Recipe.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.imagebuilder.ImageRecipe("example", {
* blockDeviceMappings: [{
* deviceName: "/dev/xvdb",
* ebs: {
* deleteOnTermination: "true",
* volumeSize: 100,
* volumeType: "gp2",
* },
* }],
* components: [{
* componentArn: exampleAwsImagebuilderComponent.arn,
* parameters: [
* {
* name: "Parameter1",
* value: "Value1",
* },
* {
* name: "Parameter2",
* value: "Value2",
* },
* ],
* }],
* name: "example",
* parentImage: `arn:${current.partition}:imagebuilder:${currentAwsRegion.region}:aws:image/amazon-linux-2-x86/x.x.x`,
* version: "1.0.0",
* });
* ```
*
* ## Import
*
* ### Identity Schema
*
* #### Required
*
* - `arn` (String) Amazon Resource Name (ARN) of the Image Builder image recipe.
*
* Using `pulumi import`, import `aws_imagebuilder_image_recipe` resources using the Amazon Resource Name (ARN). For example:
*
* console
*
* % pulumi import aws_imagebuilder_image_recipe.example arn:aws:imagebuilder:us-east-1:123456789012:image-recipe/example/1.0.0
*/
class ImageRecipe extends pulumi.CustomResource {
/**
* Get an existing ImageRecipe 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 ImageRecipe(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ImageRecipe. 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'] === ImageRecipe.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["amiTags"] = state?.amiTags;
resourceInputs["arn"] = state?.arn;
resourceInputs["blockDeviceMappings"] = state?.blockDeviceMappings;
resourceInputs["components"] = state?.components;
resourceInputs["dateCreated"] = state?.dateCreated;
resourceInputs["description"] = state?.description;
resourceInputs["name"] = state?.name;
resourceInputs["owner"] = state?.owner;
resourceInputs["parentImage"] = state?.parentImage;
resourceInputs["platform"] = state?.platform;
resourceInputs["region"] = state?.region;
resourceInputs["systemsManagerAgent"] = state?.systemsManagerAgent;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["userDataBase64"] = state?.userDataBase64;
resourceInputs["version"] = state?.version;
resourceInputs["workingDirectory"] = state?.workingDirectory;
}
else {
const args = argsOrState;
if (args?.components === undefined && !opts.urn) {
throw new Error("Missing required property 'components'");
}
if (args?.parentImage === undefined && !opts.urn) {
throw new Error("Missing required property 'parentImage'");
}
if (args?.version === undefined && !opts.urn) {
throw new Error("Missing required property 'version'");
}
resourceInputs["amiTags"] = args?.amiTags;
resourceInputs["blockDeviceMappings"] = args?.blockDeviceMappings;
resourceInputs["components"] = args?.components;
resourceInputs["description"] = args?.description;
resourceInputs["name"] = args?.name;
resourceInputs["parentImage"] = args?.parentImage;
resourceInputs["region"] = args?.region;
resourceInputs["systemsManagerAgent"] = args?.systemsManagerAgent;
resourceInputs["tags"] = args?.tags;
resourceInputs["userDataBase64"] = args?.userDataBase64;
resourceInputs["version"] = args?.version;
resourceInputs["workingDirectory"] = args?.workingDirectory;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["dateCreated"] = undefined /*out*/;
resourceInputs["owner"] = undefined /*out*/;
resourceInputs["platform"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ImageRecipe.__pulumiType, name, resourceInputs, opts);
}
}
exports.ImageRecipe = ImageRecipe;
/** @internal */
ImageRecipe.__pulumiType = 'aws:imagebuilder/imageRecipe:ImageRecipe';
//# sourceMappingURL=imageRecipe.js.map