Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The AWS Access Key Id does not exist in our records

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?

like image 620
kaushikdr Avatar asked Aug 20 '16 07:08

kaushikdr


People also ask

How do I get the secret key and access key in AWS root?

Choose your account name in the navigation bar, and then choose My Security Credentials. If you see a warning about accessing the security credentials for your AWS account, choose Continue to Security Credentials. Expand the Access keys (access key ID and secret access key) section. Choose Create New Access Key.

How do I use AWS Access Key?

Access Key ID and Secret Access Key are for API/CLI/SDK access. For IAM sign-in dashboard, you need the username and password. When a new IAM user is added, the user gets the username, password, access key and secret key, and the IAM URL from the IAM admin. You can understand this better with the AWS training.

How do I delete AWS configuration profile?

To remove a setting, use an empty string as the value, or manually delete the setting in your config and credentials files in a text editor. You can retrieve any credentials or configuration settings you've set using aws configure get . Specify the profile that you want to view or modify with the --profile setting.


1 Answers

It might be happening that you have the old keys exported via env variables (bash_profile) and since the env variables have higher precedence over credential files it is giving the error "the access key id does not exists".

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

Happened with me once earlier when I forgot I have credentials in bash_profile and gave me headache for quite some time :)

like image 199
Manish Joshi Avatar answered Sep 20 '22 15:09

Manish Joshi