AWS S3 boto3 Client Unable to locate Credentials

engrmahabub
Mahabubur Rahman
Published on Nov, 26 2023 1 min read 0 comments
image

 

botocore.exceptions.NoCredentialsError: Unable to locate credentials

 

This exception occurred when you try boto3 client API without credentials as bellow -

 

client = boto3.client('ce',region_name='ap-southeast-1')

 

So you need to try boto3 client API with right credentials as bellow - 

 

client = boto3.client('ce', region_name='ap-southeast-1',
                      aws_access_key_id='YOUR_KEY_ID',
                      aws_secret_access_key='YOUR_ACCESS_KEY')
0 Comments