I have a Lambda Function that starts a transcription job using a file uploaded to an s3 bucket. When the Lambda is triggered, the job is started using "start_transcription_job".
I then want to print the output of "get_transcription_job" in order to see its contents, but it's executed too quickly and it prints the response while 'TranscriptionJobStatus' = IN_PROGRESS.
I'd only like it to print the response when the status = completed. I tried using time.sleep(5) before the get_transcription_job method but the Lambda function times out.
You can use a loop to keep checking the status, and exit the loop when the status is either Completed or Failed. There is a Boto3 example in the SDK Code Examples Library here that looks similar to what you could try: