WaitProps

class aws_cdk.aws_stepfunctions.WaitProps(*, time, comment=None)

Bases: object

Properties for defining a Wait state.

Parameters:
  • time (WaitTime) – Wait duration.

  • comment (Optional[str]) – An optional description for this state. Default: No comment

ExampleMetadata:

infused

Example:

convert_to_seconds = tasks.EvaluateExpression(self, "Convert to seconds",
    expression="$.waitMilliseconds / 1000",
    result_path="$.waitSeconds"
)

create_message = tasks.EvaluateExpression(self, "Create message",
    # Note: this is a string inside a string.
    expression="`Now waiting ${$.waitSeconds} seconds...`",
    runtime=lambda_.Runtime.NODEJS_14_X,
    result_path="$.message"
)

publish_message = tasks.SnsPublish(self, "Publish message",
    topic=sns.Topic(self, "cool-topic"),
    message=sfn.TaskInput.from_json_path_at("$.message"),
    result_path="$.sns"
)

wait = sfn.Wait(self, "Wait",
    time=sfn.WaitTime.seconds_path("$.waitSeconds")
)

sfn.StateMachine(self, "StateMachine",
    definition=convert_to_seconds.next(create_message).next(publish_message).next(wait)
)

Attributes

comment

An optional description for this state.

Default:

No comment

time

Wait duration.