class WorkflowData
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.ImageBuilder.Alpha.WorkflowData |
Go | github.com/aws/aws-cdk-go/awsimagebuilderalpha/v2#WorkflowData |
Java | software.amazon.awscdk.services.imagebuilder.alpha.WorkflowData |
Python | aws_cdk.aws_imagebuilder_alpha.WorkflowData |
TypeScript (source) | @aws-cdk/aws-imagebuilder-alpha ยป WorkflowData |
Helper class for referencing and uploading workflow data.
Example
const workflow = new imagebuilder.Workflow(this, 'EncryptedWorkflow', {
workflowType: imagebuilder.WorkflowType.BUILD,
kmsKey: new kms.Key(this, 'WorkflowKey'),
data: imagebuilder.WorkflowData.fromJsonObject({
schemaVersion: imagebuilder.WorkflowSchemaVersion.V1_0,
steps: [
{
name: 'LaunchBuildInstance',
action: imagebuilder.WorkflowAction.LAUNCH_INSTANCE,
onFailure: imagebuilder.WorkflowOnFailure.ABORT,
inputs: {
waitFor: 'ssmAgent',
},
},
{
name: 'CreateImage',
action: imagebuilder.WorkflowAction.CREATE_IMAGE,
onFailure: imagebuilder.WorkflowOnFailure.ABORT,
inputs: {
'instanceId': 'i-123',
},
},
{
name: 'TerminateInstance',
action: imagebuilder.WorkflowAction.TERMINATE_INSTANCE,
onFailure: imagebuilder.WorkflowOnFailure.CONTINUE,
inputs: {
'instanceId': 'i-123',
},
},
],
outputs: [
{
name: 'ImageId',
value: '$.stepOutputs.CreateImage.imageId',
},
],
}),
});
Initializer
new WorkflowData()
Methods
| Name | Description |
|---|---|
| render() | The rendered workflow data value, for use in CloudFormation. |
| static from | Uploads workflow data from a local file to S3 to use as the workflow data. |
| static from | Uses an inline JSON or YAML string as the workflow data. |
| static from | Uses an inline JSON object as the workflow data. |
| static from | References workflow data from a pre-existing S3 object. |
render()
public render(): WorkflowDataConfig
Returns
The rendered workflow data value, for use in CloudFormation.
- For inline workflows, data is the workflow text
- For S3-backed workflows, uri is the S3 URL
static fromAsset(scope, id, path, options?)
public static fromAsset(scope: Construct, id: string, path: string, options?: AssetOptions): S3WorkflowData
Parameters
- scope
Constructโ The construct scope. - id
stringโ Identifier of the construct. - path
stringโ The local path to the workflow data file. - options
Assetโ S3 asset upload options.Options
Returns
Uploads workflow data from a local file to S3 to use as the workflow data.
static fromInline(data)
public static fromInline(data: string): WorkflowData
Parameters
- data
stringโ An inline JSON or YAML string representing the workflow data.
Returns
Uses an inline JSON or YAML string as the workflow data.
static fromJsonObject(data)
public static fromJsonObject(data: { [string]: any }): WorkflowData
Parameters
- data
{ [string]: any }โ An inline JSON object representing the workflow data.
Returns
Uses an inline JSON object as the workflow data.
static fromS3(bucket, key)
public static fromS3(bucket: IBucket, key: string): S3WorkflowData
Parameters
- bucket
IBucketโ The S3 bucket where the workflow data is stored. - key
stringโ The S3 key of the workflow data file.
Returns
References workflow data from a pre-existing S3 object.

.NET
Go
Java
Python
TypeScript (