aws.imagebuilder.Workflow
Explore with Pulumi AI
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
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 pulumi
import pulumi_aws as aws
example = 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"
""")
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/imagebuilder"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := imagebuilder.NewWorkflow(ctx, "example", &imagebuilder.WorkflowArgs{
			Name:    pulumi.String("example"),
			Version: pulumi.String("1.0.0"),
			Type:    pulumi.String("TEST"),
			Data: pulumi.String(`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"
`),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var example = new Aws.ImageBuilder.Workflow("example", new()
    {
        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""
",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.imagebuilder.Workflow;
import com.pulumi.aws.imagebuilder.WorkflowArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        var example = new Workflow("example", WorkflowArgs.builder()
            .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"
            """)
            .build());
    }
}
resources:
  example:
    type: aws:imagebuilder:Workflow
    properties:
      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"        
Create Workflow Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Workflow(name: string, args: WorkflowArgs, opts?: CustomResourceOptions);@overload
def Workflow(resource_name: str,
             args: WorkflowArgs,
             opts: Optional[ResourceOptions] = None)
@overload
def Workflow(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             type: Optional[str] = None,
             version: Optional[str] = None,
             change_description: Optional[str] = None,
             data: Optional[str] = None,
             description: Optional[str] = None,
             kms_key_id: Optional[str] = None,
             name: Optional[str] = None,
             tags: Optional[Mapping[str, str]] = None,
             uri: Optional[str] = None)func NewWorkflow(ctx *Context, name string, args WorkflowArgs, opts ...ResourceOption) (*Workflow, error)public Workflow(string name, WorkflowArgs args, CustomResourceOptions? opts = null)
public Workflow(String name, WorkflowArgs args)
public Workflow(String name, WorkflowArgs args, CustomResourceOptions options)
type: aws:imagebuilder:Workflow
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args WorkflowArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args WorkflowArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args WorkflowArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WorkflowArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WorkflowArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var awsWorkflowResource = new Aws.ImageBuilder.Workflow("awsWorkflowResource", new()
{
    Type = "string",
    Version = "string",
    ChangeDescription = "string",
    Data = "string",
    Description = "string",
    KmsKeyId = "string",
    Name = "string",
    Tags = 
    {
        { "string", "string" },
    },
    Uri = "string",
});
example, err := imagebuilder.NewWorkflow(ctx, "awsWorkflowResource", &imagebuilder.WorkflowArgs{
	Type:              pulumi.String("string"),
	Version:           pulumi.String("string"),
	ChangeDescription: pulumi.String("string"),
	Data:              pulumi.String("string"),
	Description:       pulumi.String("string"),
	KmsKeyId:          pulumi.String("string"),
	Name:              pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Uri: pulumi.String("string"),
})
var awsWorkflowResource = new Workflow("awsWorkflowResource", WorkflowArgs.builder()
    .type("string")
    .version("string")
    .changeDescription("string")
    .data("string")
    .description("string")
    .kmsKeyId("string")
    .name("string")
    .tags(Map.of("string", "string"))
    .uri("string")
    .build());
aws_workflow_resource = aws.imagebuilder.Workflow("awsWorkflowResource",
    type="string",
    version="string",
    change_description="string",
    data="string",
    description="string",
    kms_key_id="string",
    name="string",
    tags={
        "string": "string",
    },
    uri="string")
const awsWorkflowResource = new aws.imagebuilder.Workflow("awsWorkflowResource", {
    type: "string",
    version: "string",
    changeDescription: "string",
    data: "string",
    description: "string",
    kmsKeyId: "string",
    name: "string",
    tags: {
        string: "string",
    },
    uri: "string",
});
type: aws:imagebuilder:Workflow
properties:
    changeDescription: string
    data: string
    description: string
    kmsKeyId: string
    name: string
    tags:
        string: string
    type: string
    uri: string
    version: string
Workflow Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Workflow resource accepts the following input properties:
- Type string
- Type of the workflow. Valid values: BUILD,TEST.
- Version string
- Version of the workflow. - The following arguments are optional: 
- ChangeDescription string
- Change description of the workflow.
- Data string
- Inline YAML string with data of the workflow. Exactly one of dataandurican be specified.
- Description string
- Description of the workflow.
- KmsKey stringId 
- Amazon Resource Name (ARN) of the Key Management Service (KMS) Key used to encrypt the workflow.
- Name string
- Name of the workflow.
- Dictionary<string, string>
- Key-value map of resource tags for the workflow. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Uri string
- S3 URI with data of the workflow. Exactly one of dataandurican be specified.
- Type string
- Type of the workflow. Valid values: BUILD,TEST.
- Version string
- Version of the workflow. - The following arguments are optional: 
- ChangeDescription string
- Change description of the workflow.
- Data string
- Inline YAML string with data of the workflow. Exactly one of dataandurican be specified.
- Description string
- Description of the workflow.
- KmsKey stringId 
- Amazon Resource Name (ARN) of the Key Management Service (KMS) Key used to encrypt the workflow.
- Name string
- Name of the workflow.
- map[string]string
- Key-value map of resource tags for the workflow. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Uri string
- S3 URI with data of the workflow. Exactly one of dataandurican be specified.
- type String
- Type of the workflow. Valid values: BUILD,TEST.
- version String
- Version of the workflow. - The following arguments are optional: 
- changeDescription String
- Change description of the workflow.
- data String
- Inline YAML string with data of the workflow. Exactly one of dataandurican be specified.
- description String
- Description of the workflow.
- kmsKey StringId 
- Amazon Resource Name (ARN) of the Key Management Service (KMS) Key used to encrypt the workflow.
- name String
- Name of the workflow.
- Map<String,String>
- Key-value map of resource tags for the workflow. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- uri String
- S3 URI with data of the workflow. Exactly one of dataandurican be specified.
- type string
- Type of the workflow. Valid values: BUILD,TEST.
- version string
- Version of the workflow. - The following arguments are optional: 
- changeDescription string
- Change description of the workflow.
- data string
- Inline YAML string with data of the workflow. Exactly one of dataandurican be specified.
- description string
- Description of the workflow.
- kmsKey stringId 
- Amazon Resource Name (ARN) of the Key Management Service (KMS) Key used to encrypt the workflow.
- name string
- Name of the workflow.
- {[key: string]: string}
- Key-value map of resource tags for the workflow. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- uri string
- S3 URI with data of the workflow. Exactly one of dataandurican be specified.
- type str
- Type of the workflow. Valid values: BUILD,TEST.
- version str
- Version of the workflow. - The following arguments are optional: 
- change_description str
- Change description of the workflow.
- data str
- Inline YAML string with data of the workflow. Exactly one of dataandurican be specified.
- description str
- Description of the workflow.
- kms_key_ strid 
- Amazon Resource Name (ARN) of the Key Management Service (KMS) Key used to encrypt the workflow.
- name str
- Name of the workflow.
- Mapping[str, str]
- Key-value map of resource tags for the workflow. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- uri str
- S3 URI with data of the workflow. Exactly one of dataandurican be specified.
- type String
- Type of the workflow. Valid values: BUILD,TEST.
- version String
- Version of the workflow. - The following arguments are optional: 
- changeDescription String
- Change description of the workflow.
- data String
- Inline YAML string with data of the workflow. Exactly one of dataandurican be specified.
- description String
- Description of the workflow.
- kmsKey StringId 
- Amazon Resource Name (ARN) of the Key Management Service (KMS) Key used to encrypt the workflow.
- name String
- Name of the workflow.
- Map<String>
- Key-value map of resource tags for the workflow. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- uri String
- S3 URI with data of the workflow. Exactly one of dataandurican be specified.
Outputs
All input properties are implicitly available as output properties. Additionally, the Workflow resource produces the following output properties:
- Arn string
- Amazon Resource Name (ARN) of the workflow.
- DateCreated string
- Date the workflow was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Owner string
- Owner of the workflow.
- Dictionary<string, string>
- Arn string
- Amazon Resource Name (ARN) of the workflow.
- DateCreated string
- Date the workflow was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Owner string
- Owner of the workflow.
- map[string]string
- arn String
- Amazon Resource Name (ARN) of the workflow.
- dateCreated String
- Date the workflow was created.
- id String
- The provider-assigned unique ID for this managed resource.
- owner String
- Owner of the workflow.
- Map<String,String>
- arn string
- Amazon Resource Name (ARN) of the workflow.
- dateCreated string
- Date the workflow was created.
- id string
- The provider-assigned unique ID for this managed resource.
- owner string
- Owner of the workflow.
- {[key: string]: string}
- arn str
- Amazon Resource Name (ARN) of the workflow.
- date_created str
- Date the workflow was created.
- id str
- The provider-assigned unique ID for this managed resource.
- owner str
- Owner of the workflow.
- Mapping[str, str]
- arn String
- Amazon Resource Name (ARN) of the workflow.
- dateCreated String
- Date the workflow was created.
- id String
- The provider-assigned unique ID for this managed resource.
- owner String
- Owner of the workflow.
- Map<String>
Look up Existing Workflow Resource
Get an existing Workflow resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: WorkflowState, opts?: CustomResourceOptions): Workflow@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        change_description: Optional[str] = None,
        data: Optional[str] = None,
        date_created: Optional[str] = None,
        description: Optional[str] = None,
        kms_key_id: Optional[str] = None,
        name: Optional[str] = None,
        owner: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        type: Optional[str] = None,
        uri: Optional[str] = None,
        version: Optional[str] = None) -> Workflowfunc GetWorkflow(ctx *Context, name string, id IDInput, state *WorkflowState, opts ...ResourceOption) (*Workflow, error)public static Workflow Get(string name, Input<string> id, WorkflowState? state, CustomResourceOptions? opts = null)public static Workflow get(String name, Output<String> id, WorkflowState state, CustomResourceOptions options)resources:  _:    type: aws:imagebuilder:Workflow    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Arn string
- Amazon Resource Name (ARN) of the workflow.
- ChangeDescription string
- Change description of the workflow.
- Data string
- Inline YAML string with data of the workflow. Exactly one of dataandurican be specified.
- DateCreated string
- Date the workflow was created.
- Description string
- Description of the workflow.
- KmsKey stringId 
- Amazon Resource Name (ARN) of the Key Management Service (KMS) Key used to encrypt the workflow.
- Name string
- Name of the workflow.
- Owner string
- Owner of the workflow.
- Dictionary<string, string>
- Key-value map of resource tags for the workflow. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Dictionary<string, string>
- Type string
- Type of the workflow. Valid values: BUILD,TEST.
- Uri string
- S3 URI with data of the workflow. Exactly one of dataandurican be specified.
- Version string
- Version of the workflow. - The following arguments are optional: 
- Arn string
- Amazon Resource Name (ARN) of the workflow.
- ChangeDescription string
- Change description of the workflow.
- Data string
- Inline YAML string with data of the workflow. Exactly one of dataandurican be specified.
- DateCreated string
- Date the workflow was created.
- Description string
- Description of the workflow.
- KmsKey stringId 
- Amazon Resource Name (ARN) of the Key Management Service (KMS) Key used to encrypt the workflow.
- Name string
- Name of the workflow.
- Owner string
- Owner of the workflow.
- map[string]string
- Key-value map of resource tags for the workflow. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- map[string]string
- Type string
- Type of the workflow. Valid values: BUILD,TEST.
- Uri string
- S3 URI with data of the workflow. Exactly one of dataandurican be specified.
- Version string
- Version of the workflow. - The following arguments are optional: 
- arn String
- Amazon Resource Name (ARN) of the workflow.
- changeDescription String
- Change description of the workflow.
- data String
- Inline YAML string with data of the workflow. Exactly one of dataandurican be specified.
- dateCreated String
- Date the workflow was created.
- description String
- Description of the workflow.
- kmsKey StringId 
- Amazon Resource Name (ARN) of the Key Management Service (KMS) Key used to encrypt the workflow.
- name String
- Name of the workflow.
- owner String
- Owner of the workflow.
- Map<String,String>
- Key-value map of resource tags for the workflow. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Map<String,String>
- type String
- Type of the workflow. Valid values: BUILD,TEST.
- uri String
- S3 URI with data of the workflow. Exactly one of dataandurican be specified.
- version String
- Version of the workflow. - The following arguments are optional: 
- arn string
- Amazon Resource Name (ARN) of the workflow.
- changeDescription string
- Change description of the workflow.
- data string
- Inline YAML string with data of the workflow. Exactly one of dataandurican be specified.
- dateCreated string
- Date the workflow was created.
- description string
- Description of the workflow.
- kmsKey stringId 
- Amazon Resource Name (ARN) of the Key Management Service (KMS) Key used to encrypt the workflow.
- name string
- Name of the workflow.
- owner string
- Owner of the workflow.
- {[key: string]: string}
- Key-value map of resource tags for the workflow. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- {[key: string]: string}
- type string
- Type of the workflow. Valid values: BUILD,TEST.
- uri string
- S3 URI with data of the workflow. Exactly one of dataandurican be specified.
- version string
- Version of the workflow. - The following arguments are optional: 
- arn str
- Amazon Resource Name (ARN) of the workflow.
- change_description str
- Change description of the workflow.
- data str
- Inline YAML string with data of the workflow. Exactly one of dataandurican be specified.
- date_created str
- Date the workflow was created.
- description str
- Description of the workflow.
- kms_key_ strid 
- Amazon Resource Name (ARN) of the Key Management Service (KMS) Key used to encrypt the workflow.
- name str
- Name of the workflow.
- owner str
- Owner of the workflow.
- Mapping[str, str]
- Key-value map of resource tags for the workflow. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Mapping[str, str]
- type str
- Type of the workflow. Valid values: BUILD,TEST.
- uri str
- S3 URI with data of the workflow. Exactly one of dataandurican be specified.
- version str
- Version of the workflow. - The following arguments are optional: 
- arn String
- Amazon Resource Name (ARN) of the workflow.
- changeDescription String
- Change description of the workflow.
- data String
- Inline YAML string with data of the workflow. Exactly one of dataandurican be specified.
- dateCreated String
- Date the workflow was created.
- description String
- Description of the workflow.
- kmsKey StringId 
- Amazon Resource Name (ARN) of the Key Management Service (KMS) Key used to encrypt the workflow.
- name String
- Name of the workflow.
- owner String
- Owner of the workflow.
- Map<String>
- Key-value map of resource tags for the workflow. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Map<String>
- type String
- Type of the workflow. Valid values: BUILD,TEST.
- uri String
- S3 URI with data of the workflow. Exactly one of dataandurican be specified.
- version String
- Version of the workflow. - The following arguments are optional: 
Import
Using pulumi import, import EC2 Image Builder Workflow using the example_id_arg. For example:
$ 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.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.