“您提供的AWS Access Key ID在我们的记录中不存在."尝试使用AWS CLI时 [英] "The AWS Access Key Id you provided does not exist in our records." when trying to use AWS CLI
问题描述
我正在尝试通过cli访问我的S3存储桶.我已经进行了所有设置,例如在进行此cli工作的地方有一个credentials
文件,确保其中的$AWS_SECRET_ACCESS_KEY
和$AWS_ACCESS_KEY_ID
环境变量包含正确的内容,然后使用aws configure
手动设置它们
I'm trying to access my S3 Bucket through the cli. I have everything setup up such as having a credentials
file where I'm doing this cli work, making sure my environment variables for $AWS_SECRET_ACCESS_KEY
and $AWS_ACCESS_KEY_ID
have the right things in it, and manually setting them using aws configure
.
credentials
包含以下信息,所有信息都为空白:
credentials
contains the following information, all blanked out that is:
[sts]
aws_access_key_id = ASIAXXXXXXXXXXXXXXXX
aws_secret_access_key = XXXXXXXXXXXXXXXXXXXXXXXXX
aws_security_token = XXXXXXXXXXXXXXXXXXXXXX
aws_session_expiration = 2018-11-03T00:21:25+0000
aws_session_token = XXXXXXXXXXXXXXXXXXXXXXX
[default]
aws_access_key_id = ASIAXXXXXXXXXXXXXXXXXXX
aws_secret_access_key = XXXXXXXXXXXXXXXXXXX
还要确保已完成所有设置,所以我还运行了aws configure
:
Also just to make sure I have everything setup, I also ran aws configure
:
(venv) ~/.aws $ aws configure list
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key ****************XXXX shared-credentials-file
secret_key ****************XXXX shared-credentials-file
region
us-east-1 config-file ~/.aws/config
但是,当我运行以下命令时,它说我有此错误:
However, when I run the following, it says I have this error:
(venv) ~/.aws $ aws s3 sync s3://mybucket/my/path ~/my/path
fatal error: An error occurred (InvalidAccessKeyId) when calling the ListObjectsV2 operation: The AWS Access Key Id you provided does not exist in our records.
我不知道如何解决此问题,并用尽了我所有的Google搜索选项.
I have no idea how to get around this and exhausted all my Googling options.
推荐答案
以ASIA
开头的凭据是通过安全令牌服务生成的临时凭据,必须与令牌一起使用.
Credentials starting with ASIA
are temporary credentials generated via the Security Token Service, and must be used with a Token.
运行aws s3 sync
命令时,它使用的是[Default]凭据,但未定义aws_security_token
.
When you run your aws s3 sync
command, it is using the [Default] credentials that do not have aws_security_token
defined.
尝试将--profile sts
添加到命令中,以使其使用[sts]凭据.
Try adding --profile sts
to the command to make it use the [sts] credentials.
这篇关于“您提供的AWS Access Key ID在我们的记录中不存在."尝试使用AWS CLI时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!