Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

I created a new Access Key and configured that in the AWS CLI with aws configure. It created the .ini file in ~/.aws/config. When I run aws s3 ls it gives:

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

AmazonS3FullAccess policy is also attached to the user. How to fix this?

2 Answers

0 votes
by (44.4k points)

The environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY may already have a value. So, check out if values you can see any values if you type these commands.

echo $AWS_SECRET_ACCESS_KEY

echo $AWS_ACCESS_KEY_ID

If yes, then reset these variables using these following commands (if you use aws configure):

unset AWS_ACCESS_KEY_ID

unset AWS_SECRET_ACCESS_KEY

To learn more about AWS, you can check out AWS Tutorial and also enroll for AWS Training.

0 votes
by (108k points)

It might be occurring that you just have the old keys transported via env variables (bash_profile) and since the env variables have higher precedence over credential files it's giving the error:

 "the access key id does not exist".

Remove the old keys from the bash_profile and you'd be good to go.

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

Browse Categories

...