UNPKG

@pulumi/aws

Version:

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

137 lines 5.86 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.Workflow = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing an AWS EC2 Image Builder Workflow. * * > Image Builder manages the workflows for the distribution stage. Therefore, using the DISTRIBUTION workflow type results in an error. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.imagebuilder.Workflow("example", { * name: "example", * version: "1.0.0", * type: "TEST", * data: `name: example * description: Workflow to test an image * schemaVersion: 1.0 * * parameters: * - name: waitForActionAtEnd * type: boolean * * steps: * - name: LaunchTestInstance * action: LaunchInstance * onFailure: Abort * inputs: * waitFor: "ssmAgent" * * - name: TerminateTestInstance * action: TerminateInstance * onFailure: Continue * inputs: * instanceId.: ".stepOutputs.LaunchTestInstance.instanceId" * * - name: WaitForActionAtEnd * action: WaitForAction * if: * booleanEquals: true * value: ".parameters.waitForActionAtEnd" * `, * }); * ``` * * ## Import * * Using `pulumi import`, import EC2 Image Builder Workflow using the `arn`. For example: * * ```sh * $ pulumi import aws:imagebuilder/workflow:Workflow example arn:aws:imagebuilder:us-east-1:aws:workflow/test/example/1.0.1/1 * ``` * Certain resource arguments, such as `uri`, cannot be read via the API and imported into Terraform. Terraform will display a difference for these arguments the first run after import if declared in the Terraform configuration for an imported resource. */ class Workflow extends pulumi.CustomResource { /** * Get an existing Workflow 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 Workflow(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Workflow. 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'] === Workflow.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["changeDescription"] = state ? state.changeDescription : undefined; resourceInputs["data"] = state ? state.data : undefined; resourceInputs["dateCreated"] = state ? state.dateCreated : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["kmsKeyId"] = state ? state.kmsKeyId : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["owner"] = state ? state.owner : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["uri"] = state ? state.uri : undefined; resourceInputs["version"] = state ? state.version : undefined; } else { const args = argsOrState; if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } if ((!args || args.version === undefined) && !opts.urn) { throw new Error("Missing required property 'version'"); } resourceInputs["changeDescription"] = args ? args.changeDescription : undefined; resourceInputs["data"] = args ? args.data : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["kmsKeyId"] = args ? args.kmsKeyId : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["uri"] = args ? args.uri : undefined; resourceInputs["version"] = args ? args.version : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["dateCreated"] = undefined /*out*/; resourceInputs["owner"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Workflow.__pulumiType, name, resourceInputs, opts); } } exports.Workflow = Workflow; /** @internal */ Workflow.__pulumiType = 'aws:imagebuilder/workflow:Workflow'; //# sourceMappingURL=workflow.js.map