Created
November 24, 2020 20:37
-
-
Save WajahatAliAbid/311230272dbd4fd3a476f7576fd87186 to your computer and use it in GitHub Desktop.
Recursive Amazon State machine definition
This file contains 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": "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