Skip to content

Invalid Access Key ID

0

I am currently using AWS CLI and for some reason I get this error. Eventhough my access key and secret keys was generated with S3BucketFullAccess policy to my user. When I tried doing aws s3 ls on the terminal after configuring of course, I got this error.

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

This happen even tho I configure it with the access and secret key I generated. PLEASE HELP !!!

2 Answers
0

First thing to do is verify the keys are current aws iam list-access-keys and confirm the status is active.

Then aws configure list and you should be able to see the last four characters of the access key & the secret key. Do these match up with the key that you created?

EXPERT
answered 3 years ago
0

Verify that the access key and secret access key are correct by using the following command.
Also, try restarting the shell after changing the access key and secret access key settings.

aws configure list

That error can also occur if the access key or secret access key is incorrect or if the region is spelled incorrectly, so please check.

Also, check to see if there are any access keys, etc. set in the shell environment variables.
If it is set in a shell environment variable, it has a higher priority to be read than the credential file and should be removed.

echo $AWS_SECRET_ACCESS_KEY
echo $AWS_ACCESS_KEY_ID

Deletion can be done with the following command.

unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
EXPERT
answered 3 years ago

This post is closed: Adding new answers, comments, and votes is disabled.