Class WaitTime
Represents the Wait state which delays a state machine from continuing for a specified time.
Namespace: Amazon.CDK.AWS.StepFunctions
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class WaitTime : DeputyBase
Syntax (vb)
Public Class WaitTime Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
var convertToSeconds = new EvaluateExpression(this, "Convert to seconds", new EvaluateExpressionProps {
Expression = "$.waitMilliseconds / 1000",
ResultPath = "$.waitSeconds"
});
var createMessage = new EvaluateExpression(this, "Create message", new EvaluateExpressionProps {
// Note: this is a string inside a string.
Expression = "`Now waiting ${$.waitSeconds} seconds...`",
Runtime = Runtime.NODEJS_LATEST,
ResultPath = "$.message"
});
var publishMessage = new SnsPublish(this, "Publish message", new SnsPublishProps {
Topic = new Topic(this, "cool-topic"),
Message = TaskInput.FromJsonPathAt("$.message"),
ResultPath = "$.sns"
});
var wait = new Wait(this, "Wait", new WaitProps {
Time = WaitTime.SecondsPath("$.waitSeconds")
});
new StateMachine(this, "StateMachine", new StateMachineProps {
Definition = convertToSeconds.Next(createMessage).Next(publishMessage).Next(wait)
});
Synopsis
Methods
Duration(Duration) | Wait a fixed amount of time. |
Seconds(string) | Wait for a number of seconds stored in the state object from string. This method can use JSONata expression. |
SecondsPath(string) | Wait for a number of seconds stored in the state object. |
Timestamp(string) | Wait until the given ISO8601 timestamp. This method can use JSONata expression. |
TimestampPath(string) | Wait until a timestamp found in the state object. |
Methods
Duration(Duration)
Wait a fixed amount of time.
public static WaitTime Duration(Duration duration)
Parameters
- duration Duration
Returns
Remarks
ExampleMetadata: infused
Seconds(string)
Wait for a number of seconds stored in the state object from string. This method can use JSONata expression.
public static WaitTime Seconds(string seconds)
Parameters
- seconds string
Returns
Remarks
If you want to use fixed value, we recommend using WaitTime.duration()
Example value: {% $waitSeconds %}
SecondsPath(string)
Wait for a number of seconds stored in the state object.
public static WaitTime SecondsPath(string path)
Parameters
- path string
Returns
Remarks
Example value: $.waitSeconds
Timestamp(string)
Wait until the given ISO8601 timestamp. This method can use JSONata expression.
public static WaitTime Timestamp(string timestamp)
Parameters
- timestamp string
Returns
Remarks
Example value: 2016-03-14T01:59:00Z