Created
January 7, 2021 11:58
-
-
Save toddlers/0b51e843b0fb815d8d3f230e25c42d84 to your computer and use it in GitHub Desktop.
intrinsic functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Comment": "A Catch example of the Amazon States Language using an AWS Lambda Function", | |
"StartAt": "nextstep", | |
"States": { | |
"nextstep": { | |
"Type": "Task", | |
"Resource": "arn:aws:lambda:eu-central-1:1234567890:function:catcherror", | |
"Parameters": { | |
"executionId.$": "States.Format('somestring {}', $$.Execution.Id)" | |
}, | |
"End": true | |
} | |
} | |
} | |
{
"Comment": "A Catch example of the Amazon States Language using an AWS Lambda Function",
"StartAt": "nextstep",
"States": {
"nextstep": {
"Type": "Task",
"Resource": "arn:aws:lambda:eu-central-1: 1234567890:function:catcherror",
"ResultPath": "$.randomstring",
"Parameters": {
"executionId.$": "States.Format('somestring {}', $$.Execution.Id)"
},
"End": true
}
}
}
outputs execution id by parsing arn:aws:states:eu-central-1: 1234567890:execution:Catchfailure:2e7a5795-1d12-7a50-936c-47d8fbaf301d
{
"Comment": "A Catch example of the Amazon States Language using an AWS Lambda Function",
"StartAt": "nextstep",
"States": {
"nextstep": {
"Type": "Task",
"Resource": "arn:aws:lambda:eu-central-1: 1234567890:function:catcherror",
"ResultPath": "$.randomstring",
"Parameters": {
"executionId.$": "States.Format('somestring {}', $$.Execution.Id)"
},
"Next": "Pass"
},
"Pass": {
"Type": "Pass",
"OutputPath": "$.randomstring",
"End": true
}
}
}
output :
{
"Comment": "A Catch example of the Amazon States Language using an AWS Lambda Function",
"StartAt": "nextstep",
"States": {
"nextstep": {
"Type": "Task",
"Resource": "arn:aws:lambda:eu-central-1:1234567890:function:catcherror",
"ResultPath": "$.randomstring",
"Parameters": {
"executionName.$": "$$.Execution.Name"
},
"Next": "PassRandomeString"
},
"PassRandomeString": {
"Type": "Task",
"Resource": "arn:aws:lambda:eu-central-1: 1234567890:function:mytestfunction",
"Parameters": {
"randomstring.$": "$.randomstring"
},
"End": true
}
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
corresponding output from function
In this what you are looking for like a random string , that too is not returned by
$$.Execution.Id
. So would be good to use a lambda to generate the string and use that for furtherStates.Format