interface WaitProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.StepFunctions.WaitProps |
![]() | software.amazon.awscdk.services.stepfunctions.WaitProps |
![]() | aws_cdk.aws_stepfunctions.WaitProps |
![]() | @aws-cdk/aws-stepfunctions » WaitProps |
Properties for defining a Wait state.
Example
const convertToSeconds = new tasks.EvaluateExpression(this, 'Convert to seconds', {
expression: '$.waitMilliseconds / 1000',
resultPath: '$.waitSeconds',
});
const createMessage = new tasks.EvaluateExpression(this, 'Create message', {
// Note: this is a string inside a string.
expression: '`Now waiting ${$.waitSeconds} seconds...`',
runtime: lambda.Runtime.NODEJS_14_X,
resultPath: '$.message',
});
const publishMessage = new tasks.SnsPublish(this, 'Publish message', {
topic: new sns.Topic(this, 'cool-topic'),
message: sfn.TaskInput.fromJsonPathAt('$.message'),
resultPath: '$.sns',
});
const wait = new sfn.Wait(this, 'Wait', {
time: sfn.WaitTime.secondsPath('$.waitSeconds'),
});
new sfn.StateMachine(this, 'StateMachine', {
definition: convertToSeconds
.next(createMessage)
.next(publishMessage)
.next(wait),
});
Properties
Name | Type | Description |
---|---|---|
time | Wait | Wait duration. |
comment? | string | An optional description for this state. |
time
Type:
Wait
Wait duration.
comment?
Type:
string
(optional, default: No comment)
An optional description for this state.