尝试同步时收到错误消息“您提供的AWS Access Key ID在我们的记录中不存在”

时间:2019-08-21 20:04:10

标签: amazon-web-services amazon-s3

我正在尝试将所有可用文件从s3存储桶下载到本地计算机。我已经安装了AWS cli。然后我也使用aws configure来设置访问密钥和秘密密钥。尝试执行以下命令时遇到问题:

$ aws s3 sync s3://tempobjects .

设置命令

LAMU02XRK97:s3 vsing$ export AWS_ACCESS_KEY_ID=*******kHXE
LAMU02XRK97:s3 vsing$ export AWS_SECRET_ACCESS_KEY=******Ssv

LAMU02XRK97:s3 vsing$ aws configure list
      Name                    Value             Type    Location
      ----                    -----             ----    --------
   profile                <not set>             None    None
access_key     ****************kHXE shared-credentials-file    
secret_key     ****************pSsv shared-credentials-file    
    region                us-east-1      config-file    ~/.aws/config

错误:

LAMU02XRK97:s3 vsing$ aws s3 sync s3://tempobjects .
fatal error: An error occurred (InvalidAccessKeyId) when calling the ListObjectsV2 operation: The AWS Access Key Id you provided does not exist in our records.

1 个答案:

答案 0 :(得分:2)

我已经复制了该方案,并且要使其正常运行,您需要确保用于CLI的用户在IAM中配置了相同的访问密钥。

以下是AWS CLI中配置的内容。

enter image description here

以下是在AWS IAM中为同一用户配置的内容:

enter image description here

在两个地方都配置了以QYHP结尾的访问密钥,因此对我来说很好用。