Created
          January 20, 2021 01:53 
        
      - 
      
 - 
        
Save petereskandar/8cfb07b5ed311c77b6643593a23a1ca3 to your computer and use it in GitHub Desktop.  
    State Machine Configuration
  
        
  
    
      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": "Transcribe an object uploded to S£", | |
| "StartAt": "transcribe", | |
| "States": { | |
| "transcribe": { | |
| "Type": "Task", | |
| "Resource": "arn:aws:states:::lambda:invoke", | |
| "Parameters": { | |
| "FunctionName": "arn:aws:lambda:region:account_id:function:transcribeS3ObjOnUpload:$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:region:account_id:function:lambdaTranscribeStatusChecker:$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" | |
| }, | |
| "delete-transcription-job": { | |
| "Type": "Task", | |
| "Resource": "arn:aws:states:::lambda:invoke", | |
| "Parameters": { | |
| "FunctionName": "arn:aws:lambda:region:account_id:function:deleteTranscriptionJob:$LATEST", | |
| "Payload": { | |
| "Input.$": "$" | |
| } | |
| }, | |
| "End": true | |
| }, | |
| "success": { | |
| "Type": "Pass", | |
| "Next": "delete-transcription-job" | |
| }, | |
| "error": { | |
| "Type": "Pass", | |
| "Next": "delete-transcription-job" | |
| } | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment