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
2 Antworten
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
EXPERTE
beantwortet vor 3 Monaten
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
beantwortet vor 3 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen