Skip to content

Instantly share code, notes, and snippets.

@qi-qi
Last active May 1, 2020 12:41
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 qi-qi/5203f5446cc07a0fc72ec390436675d3 to your computer and use it in GitHub Desktop.
Save qi-qi/5203f5446cc07a0fc72ec390436675d3 to your computer and use it in GitHub Desktop.
{
"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