Skip to content

Instantly share code, notes, and snippets.

@rrevo
Created September 8, 2022 05:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rrevo/adf89ec434c2fc2f57a1aa31d1c5f3b2 to your computer and use it in GitHub Desktop.
Save rrevo/adf89ec434c2fc2f57a1aa31d1c5f3b2 to your computer and use it in GitHub Desktop.
AWS Step function sample with a lambda invocation
{
"Comment": "Workflow example with lambda invocation",
"StartAt": "Fibonacci generator",
"States": {
"Fibonacci generator": {
"Type": "Task",
"Resource": "arn:aws:states:::lambda:invoke",
"OutputPath": "$.Payload",
"Parameters": {
"Payload.$": "$",
"FunctionName": "arn:aws:lambda:~~:~~:function:~~:$LATEST"
},
"Retry": [
{
"ErrorEquals": [
"Lambda.ServiceException",
"Lambda.AWSLambdaException",
"Lambda.SdkClientException"
],
"IntervalSeconds": 2,
"MaxAttempts": 6,
"BackoffRate": 2
}
],
"Next": "Mapper"
},
"Mapper": {
"Type": "Map",
"End": true,
"Iterator": {
"StartAt": "Adder",
"States": {
"Adder": {
"Type": "Pass",
"End": true,
"Parameters": {
"added.$": "States.MathAdd($, 7)"
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment