Last active
May 1, 2020 12:41
-
-
Save qi-qi/5203f5446cc07a0fc72ec390436675d3 to your computer and use it in GitHub Desktop.
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": "s3 trigger lambda and transcribe", | |
"StartAt": "transcribe", | |
"States": { | |
"transcribe": { | |
"Type": "Task", | |
"Resource": "arn:aws:states:::lambda:invoke", | |
"Parameters": { | |
"FunctionName": "arn:aws:lambda:us-east-1:274315249506:function:lab-lambda-transcribe:$LATEST", | |
"Payload": { | |
"Input.$": "$" | |
} | |
}, | |
"Next": "transcribe-wait" | |
}, | |
"transcribe-wait": { | |
"Type": "Wait", | |
"Seconds": 2, | |
"Next": "transcribe-status" | |
}, | |
"transcribe-status": { | |
"Type": "Task", | |
"Resource": "arn:aws:states:::lambda:invoke", | |
"Parameters": { | |
"FunctionName": "arn:aws:lambda:us-east-1:274315249506:function:lab-lambda-status-checker:$LATEST", | |
"Payload": { | |
"Input.$": "$" | |
} | |
}, | |
"Next": "transcribe-complete" | |
}, | |
"transcribe-complete": { | |
"Type": "Choice", | |
"Choices": [ | |
{ | |
"Variable": "$.Payload.TranscriptionJobStatus", | |
"StringEquals": "COMPLETED", | |
"Next": "success" | |
}, | |
{ | |
"Variable": "$.Payload.TranscriptionJobStatus", | |
"StringEquals": "FAILED", | |
"Next": "error" | |
} | |
], | |
"Default": "transcribe-wait" | |
}, | |
"success": { | |
"Type": "Pass", | |
"End": true | |
}, | |
"error": { | |
"Type": "Pass", | |
"End": true | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment