aws-cdk-lib.aws_stepfunctions.WaitProps

interface WaitProps

LanguageType name
.NETAmazon.CDK.AWS.StepFunctions.WaitProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctions#WaitProps
Javasoftware.amazon.awscdk.services.stepfunctions.WaitProps
Pythonaws_cdk.aws_stepfunctions.WaitProps
TypeScript (source)aws-cdk-lib » 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_16_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

NameTypeDescription
timeWaitTimeWait duration.
comment?stringAn optional description for this state.

time

Type: WaitTime

Wait duration.


comment?

Type: string (optional, default: No comment)

An optional description for this state.