Skip to content

Instantly share code, notes, and snippets.

@WajahatAliAbid
Created November 24, 2020 20:37
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 WajahatAliAbid/311230272dbd4fd3a476f7576fd87186 to your computer and use it in GitHub Desktop.
Save WajahatAliAbid/311230272dbd4fd3a476f7576fd87186 to your computer and use it in GitHub Desktop.
Recursive Amazon State machine definition
{
"Comment": "Amazon State machine to process messages from s3 and push them to Kinesis",
"StartAt": "MigrationLambda",
"States": {
"MigrationLambda": {
"Type": "Task",
"Resource": "sample-function-arn",
"Retry": [
{
"ErrorEquals": [
"Lambda.ServiceException",
"Lambda.AWSLambdaException",
"Lambda.SdkClientException"
],
"IntervalSeconds": 2,
"MaxAttempts": 6,
"BackoffRate": 2
}
],
"Comment": "Takes 5000 mesages from S3, and pushes them to Kinesis after converting them to JSON. If there are more messages, returns object containing ShouldContinue as true",
"Next": "HasProcessedAllMessages"
},
"HasProcessedAllMessages": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.ShouldContinue",
"BooleanEquals": true,
"Next": "MigrationLambda"
}
],
"Default": "Done"
},
"Done": {
"Type": "Pass",
"End": true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment