interface WaitProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.StepFunctions.WaitProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctions#WaitProps |
![]() | software.amazon.awscdk.services.stepfunctions.WaitProps |
![]() | aws_cdk.aws_stepfunctions.WaitProps |
![]() | 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_LATEST,
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. |
assign? | { [string]: any } | Workflow variables to store in this step. |
comment? | string | A comment describing this state. |
query | Query | The name of the query language used by the state. |
state | string | Optional name for this state. |
time
Type:
Wait
Wait duration.
assign?
Type:
{ [string]: any }
(optional, default: Not assign variables)
Workflow variables to store in this step.
Using workflow variables, you can store data in a step and retrieve that data in future steps.
comment?
Type:
string
(optional, default: No comment)
A comment describing this state.
queryLanguage?
Type:
Query
(optional, default: JSONPath)
The name of the query language used by the state.
If the state does not contain a queryLanguage
field,
then it will use the query language specified in the top-level queryLanguage
field.
stateName?
Type:
string
(optional, default: The construct ID will be used as state name)
Optional name for this state.