I can't put s3 object with --acl public-read option

0

Hi all,

I'm using AWS Lightsail bucket service. My account has a following policy but I can't put s3 object with --acl public-read option. without --acl option it works.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "S3BucketAccess",
            "Effect": "Allow",
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::bucketname/*",
                "arn:aws:s3:::bucketname",
            ]
        }
    ]
}
  • cli command : aws s3api put-object --bucket bucketname --key test.txt --acl public-read
  • error message : An error occurred (AccessDenied) when calling the PutObject operation: Access Denied

Thanks, in advance.

  • Larry
已提问 3 个月前119 查看次数
2 回答
0

Hello.

Since the ACL cannot be set on the Lightsail bucket using the command below, I suspect that the settings around ACL cannot be used on the Lightsail bucket.

aws s3api put-bucket-acl --bucket bucket-s7oabn --acl public-read
profile picture
专家
已回答 3 个月前
0

Hi. Could you confirm you have set the right permissions for the Lightsail bucket?

https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-configuring-bucket-permissions.html

You may need the "Individual objects can be made public" bucket permission described here which can be set via console or CLI.

https://docs.aws.amazon.com/cli/latest/reference/lightsail/update-bucket.html

The access-rules argument here.

AWS
Varun_R
已回答 3 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则