gpt4 book ai didi

amazon-web-services - AWS S3 CLI ACL public-read 给我 403 with sync 命令

转载 作者:行者123 更新时间:2023-12-01 12:38:37 28 4
gpt4 key购买 nike

我不明白为什么我在查看页面时会收到 403 权限被拒绝的错误。我通过以下命令使用 AWS CLI:

aws s3 sync [source] [s3 destination] --acl public-read --recursive --delete --profile [my_profile]

在 IAM 上,我的政策如下:

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:ListBucket"],
"Resource": ["bucket_location"]
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:PutObjectAcl",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": ["bucket_location"]
}
]
}

路径是正确的,因为它确实上传了文件,但它似乎忽略了 --acl public-read 选项。当我使用 cp 命令时,它看起来运行正常。我只是喜欢使用 sync 来使用 --delete 选项进行清理。有什么想法吗?

最佳答案

好的,感谢@sebsto 建议使用策略模拟器,我发现了以下内容:我需要 PutObjectAclPutBucketAcl。现在可以同步了。

关于amazon-web-services - AWS S3 CLI ACL public-read 给我 403 with sync 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27091924/

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