- Newest
- Most votes
- Most comments
Hello.
Do the access keys set in the "credentials" file match the access keys checked with "aws configure list"?
cat ~/.aws/credentials
By the way, what value is in the "Type" column that you checked in "aws configure list"?
If the value in the "Type" column is "env", the access key may be read from an environment variable.
Therefore, you need to take measures such as deleting the environment variable or setting a new access key in the environment variable.
Access keys set in environment variables are used in preference to the "credentials" file.
https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html#configure-precedence
Hi,
Your issue comes from the setup of the CLI with uses unknown / invalid access key
See https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html
You have different ways of setting the IAM credentials on your machine: I personally use the env vars with standard names AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. But, you can use other ways: see doc above.
Best,
Didier
So instead of aws configure I should just set system's env variable as AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY and save it with the following values ,will it work than? Is this what you were stating above.
I went through the above doc and thought of creating access key from the CLI itself for that I would require this permission right? But this is not there in the policies list { "Version": "2012-10-17", "Statement": [ { "Sid": "CreateOwnAccessKeys", "Effect": "Allow", "Action": [ "iam:CreateAccessKey", "iam:GetUser", "iam:ListAccessKeys", "iam:TagUser" ], "Resource": "arn:aws:iam::*:user/${aws:username}" } ] }
Relevant content
- Accepted Answerasked 3 months ago
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 4 days ago
- AWS OFFICIALUpdated 2 months ago
yes the credentials used by aws configure are matching the /.aws/credentials files credentials. Moreover the Type mentioned is "shared-credentials-file"
What happens if I set it in an environment variable? If the same error occurs even if you set it as an environment variable, there is a possibility that the access key is incorrect in the first place, so please reissue it or check that you have copied the correct one. https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html