Your code looks good, but since the credentials issued by Vocareum (AWS Educate) are temporary credentials, you also need to pass the aws_session_token
to boto3 -
import boto3
import time
import urllib
import json
AWS_ACCESS_KEY_ID = 'your_aws_access_key_id'
AWS_SECRET_ACCESS_KEY = 'your_aws_secret_access_key'
AWS_SESSION_TOKEN = 'your_aws_session_token'
job_name = 'job name'
job_uri = 's3.amazonaws.com/bucket_name/file_name.mp3'
transcribe = boto3.client('transcribe',
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
aws_session_token=AWS_SESSION_TOKEN,
region_name='us-east-1')
Also, you need to keep track of the session timer on your Vocareum dashboard as the token will expire when your session expires. You can refresh the timer by refreshing the Vocareum page.