java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.imagebuilder.alpha.Workflow
All Implemented Interfaces:
IEnvironmentAware, IResource, IWorkflow, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)", date="2025-12-05T22:26:50.101Z") @Stability(Experimental) public class Workflow extends Resource implements IWorkflow
(experimental) Represents an EC2 Image Builder Workflow.

Example:

 Workflow workflow = Workflow.Builder.create(this, "EncryptedWorkflow")
         .workflowType(WorkflowType.BUILD)
         .kmsKey(new Key(this, "WorkflowKey"))
         .data(WorkflowData.fromJsonObject(Map.of(
                 "schemaVersion", WorkflowSchemaVersion.V1_0,
                 "steps", List.of(Map.of(
                         "name", "LaunchBuildInstance",
                         "action", WorkflowAction.LAUNCH_INSTANCE,
                         "onFailure", WorkflowOnFailure.ABORT,
                         "inputs", Map.of(
                                 "waitFor", "ssmAgent")), Map.of(
                         "name", "CreateImage",
                         "action", WorkflowAction.CREATE_IMAGE,
                         "onFailure", WorkflowOnFailure.ABORT,
                         "inputs", Map.of(
                                 "instanceId", "i-123")), Map.of(
                         "name", "TerminateInstance",
                         "action", WorkflowAction.TERMINATE_INSTANCE,
                         "onFailure", WorkflowOnFailure.CONTINUE,
                         "inputs", Map.of(
                                 "instanceId", "i-123"))),
                 "outputs", List.of(Map.of(
                         "name", "ImageId",
                         "value", "$.stepOutputs.CreateImage.imageId")))))
         .build();
 

See Also:
  • Field Details

    • PROPERTY_INJECTION_ID

      @Stability(Experimental) public static final String PROPERTY_INJECTION_ID
      (experimental) Uniquely identifies this class.
  • Constructor Details

    • Workflow

      protected Workflow(software.amazon.jsii.JsiiObjectRef objRef)
    • Workflow

      protected Workflow(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • Workflow

      @Stability(Experimental) public Workflow(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull WorkflowProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromWorkflowArn

      @Stability(Experimental) @NotNull public static IWorkflow fromWorkflowArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String workflowArn)
      (experimental) Import an existing workflow given its ARN.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      workflowArn - This parameter is required.
    • fromWorkflowAttributes

      @Stability(Experimental) @NotNull public static IWorkflow fromWorkflowAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull WorkflowAttributes attrs)
      (experimental) Import an existing workflow by providing its attributes.

      The provided name must be normalized by converting all alphabetical characters to lowercase, and replacing all spaces and underscores with hyphens. You may not provide a dynamic expression for the workflowArn or workflowType

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      attrs - This parameter is required.
    • isWorkflow

      @Stability(Experimental) @NotNull public static Boolean isWorkflow(@NotNull Object x)
      (experimental) Return whether the given object is a Workflow.

      Parameters:
      x - This parameter is required.
    • grant

      @Stability(Experimental) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull String... actions)
      (experimental) Grant custom actions to the given grantee for the workflow.

      Specified by:
      grant in interface IWorkflow
      Parameters:
      grantee - The principal. This parameter is required.
      actions - The list of actions. This parameter is required.
    • grantRead

      @Stability(Experimental) @NotNull public Grant grantRead(@NotNull IGrantable grantee)
      (experimental) Grant read permissions to the given grantee for the workflow.

      Specified by:
      grantRead in interface IWorkflow
      Parameters:
      grantee - The principal. This parameter is required.
    • getWorkflowArn

      @Stability(Experimental) @NotNull public String getWorkflowArn()
      (experimental) The ARN of the workflow.
      Specified by:
      getWorkflowArn in interface IWorkflow
    • getWorkflowName

      @Stability(Experimental) @NotNull public String getWorkflowName()
      (experimental) The name of the workflow.
      Specified by:
      getWorkflowName in interface IWorkflow
    • getWorkflowType

      @Stability(Experimental) @NotNull public String getWorkflowType()
      (experimental) The type of the workflow.
      Specified by:
      getWorkflowType in interface IWorkflow
    • getWorkflowVersion

      @Stability(Experimental) @NotNull public String getWorkflowVersion()
      (experimental) The version of the workflow.
      Specified by:
      getWorkflowVersion in interface IWorkflow