In the aws-step function documentation, it seems possible to write a 'choice' state comparing variables from the current state. However, is it possible to write a timestamp comparison referencing the current time? For example, say I want a particular state to be enabled when the time in my state's $.myTime
property is TimestampGreaterThan
the [current time]
. For example:
{
"Variable": "$.myTime",
"TimestampGreaterThan": "<the current time>",
"Next": "MyTimeSpecificState"
}
Is it possible to reference the current time, or do I have to manually set that on the state in a separate task?
$ to the end, as you do when selecting state input with a path. Then, to access context object data instead of the input, prepend the path with $$. . This tells AWS Step Functions to use the path to select a node in the context object.
From this stream, you can create rules to route specific events to AWS Step Functions and invoke a state machine to perform further processing. AWS Step Functions allows you to coordinate multiple services into serverless workflows so you can build and update automated processes quickly.
Yes, it is currently (as of 2020) possible by using the Context Object ($$), here's how:
{
"Variable": "$.myTime",
"TimestampGreaterThan": "$$.State.EnteredTime",
"Next": "MyTimeSpecificState"
}
Here's the link to the AWS Step Functions Developers Guide: Context Object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With