WaitTime
- class aws_cdk.aws_stepfunctions.WaitTime(*args: Any, **kwargs)
Bases:
object
Represents the Wait state which delays a state machine from continuing for a specified time.
- See:
- 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_LATEST, 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) )
Static Methods
- classmethod duration(duration)
Wait a fixed amount of time.
- classmethod seconds(seconds)
Wait for a number of seconds stored in the state object from string. This method can use JSONata expression.
If you want to use fixed value, we recommend using
WaitTime.duration()
Example value:
{% $waitSeconds %}
- Parameters:
seconds (
str
) –- Return type:
- classmethod seconds_path(path)
Wait for a number of seconds stored in the state object.
Example value:
$.waitSeconds
- Parameters:
path (
str
) –- Return type:
- classmethod timestamp(timestamp)
Wait until the given ISO8601 timestamp. This method can use JSONata expression.
Example value:
2016-03-14T01:59:00Z
- Parameters:
timestamp (
str
) –- Return type: