Is their any way to connect vocareum (aws student portal) with Python?

612 Views Asked by At

I have tried to do with boto3 but boto3 redirected to the main portal of AWS not on vocareum. first it give me error that couldn't connect to the server and now it is

ClientError: An error occurred (InvalidAccessKeyId) when calling the ListBuckets operation: The AWS Access Key Id you provided does not exist in our records.

1

There are 1 best solutions below

0
On BEST ANSWER

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.