gpt4 book ai didi

AWS CLI command to copy files from s3 to local machine fails with InvalidAccessKeyId(将文件从S3复制到本地计算机的AWS CLI命令失败,错误为InvalidAccessKeyID)

转载 作者:bug小助手 更新时间:2023-10-24 22:06:12 33 4
gpt4 key购买 nike



Hi folks I am following a tutorial on the AWS platform and I am stuck at a point where I have to copy some files from an s3 to local machine. I used the following command to do that:

大家好,我正在学习AWS平台上的一个教程,我被困在一个点上,我必须将一些文件从S3复制到本地计算机。为此,我使用了以下命令:


aws s3 cp s3://wildrydes-us-east-1/WebApplication/1_StaticWebHosting/website ./ --recursive

However what I get is an error:

但我得到的是一个错误:



fatal error: An error occurred (InvalidAccessKeyId) when calling the ListObjectsV2 operation: The AWS Access Key Id you provided does not exist in our records.



更多回答

You need to configure your AWS CLI with your IAM users access key and secret key id.

您需要使用IAM用户访问密钥和密钥ID配置您的AWS CLI。

Yes I have configured by generating a new HTTPS Git credentials for AWS CodeCommit and setting them in the command line but still the error seems to appear @hephalump

是的,我已经通过为AWS CodeCommit生成新的HTTPS Git凭据并在命令行中设置它们进行了配置,但错误似乎仍显示为@hephalump

Those aren’t the credentials you’re looking for. In AWS IAM your user has access keys, you need to configure them in the AWS CLI.

这些不是你要找的证件。在AWS IAM中,您的用户拥有访问密钥,您需要在AWS CLI中配置它们。

Thanks alot @hephalump yes now it works after creating a access key and setting it in cli.

感谢alot@hephalump,是的,在创建访问密钥并将其设置为cli后,它现在可以工作了。

优秀答案推荐

As in the comments above, you must create and use an Access Key and a Secret Access Key as described in the tutorial. That will get rid of the current error. However, you will also need to grant the IAM user that is doing the copy the "AmazonS3ReadOnlyAccess" policy and wait 5 minutes. This gives the IAM user permission to read from S3.

与上面的注释一样,您必须按照本教程中的说明创建和使用访问密钥和秘密访问密钥。这将消除当前的错误。但是,您还需要向执行复制的IAM用户授予“AmazonS3ReadOnlyAccess”策略并等待5分钟。这为IAM用户提供了从S3读取的权限。


更多回答

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com