gpt4 book ai didi

amazon-web-services - S3 : An error occurred (AccessDenied) when calling the GetObject operation: Access Denied

转载 作者:行者123 更新时间:2023-12-04 08:00:28 26 4
gpt4 key购买 nike

使用命令 aws configure 配置 AWSCLI 后.我正在尝试使用以下命令将文件从 S3 存储桶下载到本地文件夹 test

aws s3 sync s3://sourceBucket  ./test --delete

但它抛出以下错误消息
download failed: s3://sourceBucket/jobs/Test/1/slider-test-0.0.1-SNAPSHOT.war to test/jobs/Test/1/slider-test-0.0.1-SNAPSHOT.war An error occurred (AccessDenied) when calling the GetObject operation: Access Denied
download failed: s3://sourceBucket/jobs/Test/2/slider-test-0.0.1-SNAPSHOT.war to test/jobs/Test/2/slider-test-0.0.1-SNAPSHOT.war An error occurred (AccessDenied) when calling the GetObject operation: Access Denied

sourceBucket 具有以下权限

sourceBucket permissions Image - clickhere

当我使用此命令检查 sourceBucket 中的对象列表时
aws s3api list-objects --bucket sourceBucket --query 'Contents[].{Key: Key, Size: Size}'

以下是它的输出
[
{
"Key": "jobs/Test/1/slider-test-0.0.1-SNAPSHOT.war",
"Size": 2546325
},
{
"Key": "jobs/Test/2/slider-test-0.0.1-SNAPSHOT.war",
"Size": 3571598
}
]

有人可以让我知道如何解决这个问题,我需要将所有对象从 s3 sourceBucket 下载到本地文件夹 test。

谢谢你。

最佳答案

如果您使用 KMS 来加密您的 S3 文件,还要确保 IAM 用户/角色有权使用适当的 key 来解密文件。在您的 KMS dashboard ,单击“客户管理的 key ”,然后单击用于 S3 存储桶的特定 key 。然后,您需要将适当的帐户/角色添加到 key 策略中。更多信息请参见:https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam

关于amazon-web-services - S3 : An error occurred (AccessDenied) when calling the GetObject operation: Access Denied,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43712854/

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