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 réponses
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
EXPERT
répondu il y a 3 mois
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
répondu il y a 3 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions