Solve - the AWS Access Key Id does not exist in our records

avatar

Borislav Hadzhiev

Wed Sep 15 20212 min read

banner

Photo by Vilde Evelyn

Solving the AWS Access Key Id does not exist in our records #

The "AWS Access Key Id does not exist in our records" error occurs when the access key id configured for the AWS CLI is invalid.

access key not exist

In order to solve the "AWS Access Key Id does not exist in our records" error:

  1. Verify whether you're setting the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables and make sure the values are correct:
shell
# Linux and macOS echo $AWS_ACCESS_KEY_ID echo $AWS_SECRET_ACCESS_KEY # on Windows with CMD echo %AWS_ACCESS_KEY_ID% echo %AWS_SECRET_ACCESS_KEY% # on Windows with PowerShell echo $Env:AWS_ACCESS_KEY_ID echo $Env:AWS_SECRET_ACCESS_KEY
If the environment variables are set, they have higher precedence and override the values in the AWS credentials file.
  1. If the environment variables are not set, verify the value of the aws_access_key_id variable in your credentials file.

    The credentials file is located at ~/.aws/credentials on Linux and macOS and at C:\Users\USERNAME\.aws\credentials on Windows.

The syntax of the credentials file should look like:

credentials
[default] aws_access_key_id=YOUR_ACCESS_KEY_ID aws_secret_access_key=YOUR_SECRET_ACCESS_KEY [admin] aws_access_key_id=YOUR_ACCESS_KEY_ID aws_secret_access_key=YOUR_SECRET_ACCESS_KEY
Make sure you don't enclose the value of your aws_access_key_id or aws_secret_access_key in single, nor double quotes.

If you want to reconfigure the credentials for the AWS profile, run the aws configure command:

shell
# configure the default profile aws configure # configure the admin profile aws configure --profile admin
  1. When working with temporary credentials, issued by the Security Token Service API, the response includes the access / security keys and a session token. Make sure you set the value for all 3 variables in your subsequent API request.

    Omitting the value of the session token often causes this error.

Further Reading #

Add me on LinkedIn

I'm a Web Developer with TypeScript, React.js, Node.js and AWS experience.

Let's connect on LinkedIn

Join my newsletter

I'll send you 1 email a week with links to all of the articles I've written that week

Buy Me A Coffee