Created
April 7, 2023 17:14
-
-
Save beabetterdevv/3a6f76e14056fea0a1112a88830ecb30 to your computer and use it in GitHub Desktop.
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 description of my state machine", | |
"StartAt": "Choice", | |
"States": { | |
"Choice": { | |
"Type": "Choice", | |
"Choices": [ | |
{ | |
"Variable": "$.type", | |
"StringEquals": "PURCHASE", | |
"Next": "Purchase Handler" | |
}, | |
{ | |
"Variable": "$.type", | |
"StringEquals": "REFUND", | |
"Next": "Refund Handler" | |
} | |
] | |
}, | |
"Purchase Handler": { | |
"Type": "Task", | |
"Resource": "arn:aws:states:::lambda:invoke", | |
"OutputPath": "$.Payload", | |
"Parameters": { | |
"Payload.$": "$", | |
"FunctionName": "arn:aws:lambda:us-east-1:755314965794:function:PurchaseHandler:$LATEST" | |
}, | |
"Retry": [ | |
{ | |
"ErrorEquals": [ | |
"Lambda.ServiceException", | |
"Lambda.AWSLambdaException", | |
"Lambda.SdkClientException", | |
"Lambda.TooManyRequestsException" | |
], | |
"IntervalSeconds": 2, | |
"MaxAttempts": 6, | |
"BackoffRate": 2 | |
} | |
], | |
"Next": "Result Handler" | |
}, | |
"Result Handler": { | |
"Type": "Task", | |
"Resource": "arn:aws:states:::lambda:invoke", | |
"OutputPath": "$.Payload", | |
"Parameters": { | |
"Payload.$": "$", | |
"FunctionName": "arn:aws:lambda:us-east-1:755314965794:function:ResultHandler:$LATEST" | |
}, | |
"Retry": [ | |
{ | |
"ErrorEquals": [ | |
"Lambda.ServiceException", | |
"Lambda.AWSLambdaException", | |
"Lambda.SdkClientException", | |
"Lambda.TooManyRequestsException" | |
], | |
"IntervalSeconds": 2, | |
"MaxAttempts": 6, | |
"BackoffRate": 2 | |
} | |
], | |
"End": true | |
}, | |
"Refund Handler": { | |
"Type": "Task", | |
"Resource": "arn:aws:states:::lambda:invoke", | |
"OutputPath": "$.Payload", | |
"Parameters": { | |
"Payload.$": "$", | |
"FunctionName": "arn:aws:lambda:us-east-1:755314965794:function:RefundHandler:$LATEST" | |
}, | |
"Retry": [ | |
{ | |
"ErrorEquals": [ | |
"Lambda.ServiceException", | |
"Lambda.AWSLambdaException", | |
"Lambda.SdkClientException", | |
"Lambda.TooManyRequestsException" | |
], | |
"IntervalSeconds": 2, | |
"MaxAttempts": 6, | |
"BackoffRate": 2 | |
} | |
], | |
"Next": "Result Handler" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment