0 votes
1 view
in AWS by (18.2k 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 (42.5k 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

0 votes
by (57.5k 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.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...