WorkflowOnFailure
- class aws_cdk.aws_imagebuilder_alpha.WorkflowOnFailure(*values)
Bases:
Enum(experimental) The action to take if the workflow fails.
- Stability:
experimental
- ExampleMetadata:
infused
Example:
workflow = imagebuilder.Workflow(self, "MyWorkflow", workflow_type=imagebuilder.WorkflowType.BUILD, data=imagebuilder.WorkflowData.from_json_object({ "schema_version": imagebuilder.WorkflowSchemaVersion.V1_0, "steps": [{ "name": "LaunchBuildInstance", "action": imagebuilder.WorkflowAction.LAUNCH_INSTANCE, "on_failure": imagebuilder.WorkflowOnFailure.ABORT, "inputs": { "wait_for": "ssmAgent" } }, { "name": "ExecuteComponents", "action": imagebuilder.WorkflowAction.EXECUTE_COMPONENTS, "on_failure": imagebuilder.WorkflowOnFailure.ABORT, "inputs": { "instance_id": "i-123" } }, { "name": "CreateImage", "action": imagebuilder.WorkflowAction.CREATE_IMAGE, "on_failure": imagebuilder.WorkflowOnFailure.ABORT, "inputs": { "instance_id": "i-123" } }, { "name": "TerminateInstance", "action": imagebuilder.WorkflowAction.TERMINATE_INSTANCE, "on_failure": imagebuilder.WorkflowOnFailure.CONTINUE, "inputs": { "instance_id": "i-123" } } ], "outputs": [{ "name": "ImageId", "value": "$.stepOutputs.CreateImage.imageId" } ] }) )
Attributes
- ABORT
(experimental) Fails the image build if the workflow fails.
- Stability:
experimental
- CONTINUE
(experimental) Continues with the image build if the workflow fails.
- Stability:
experimental