Last updated: Feb 26, 2024
Reading time·2 min
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.
To solve the error:
AWS_ACCESS_KEY_ID
and
AWS_SECRET_ACCESS_KEY
environment variables and make sure the values are
correct:# 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.
If the environment variables aren't 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 as follows.
[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
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.
# configure the default profile aws configure # configure the admin profile aws configure --profile admin
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.
You can learn more about the related topics by checking out the following tutorials: