boto3 client Unable to locate credentials

mahabub.devs3
Mahabubur Rahman
Published on Oct, 06 2024 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 crediantials 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