我无法弄清楚为什么在查看页面时会收到 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 命令时,它看起来运行正常。我只是喜欢使用同步来使用 --delete 选项进行清理。有任何想法吗?