The option "---no-object-lock-enabled-for-bucket" does not work with AWS CLI:The created bucket has always all public access blocked!

0

When I create a bucket using the AWS CLI, it has by default "block public access". When trying to create a bucket having public access enabled: I used the option from the documentation : "--no-object-lock-enabled-for-bucket", but it turns out that also with the opposite option "object-lock-enabled-for-bucket", the public access is always disabled ! Here 2 screenshots commands Enter image description here and here the results (as you see: "Bucket and objects not public" ! Enter image description here

1 Antwort
0
Akzeptierte Antwort

You are using the wrong option. ---no-object-lock-enabled-for-bucket set S3 Object Lock behavior for the bucket.

To adjust the Block Public Access use put-public-access-block.

profile pictureAWS
EXPERTE
kentrad
beantwortet vor einem Jahr
profile picture
EXPERTE
überprüft vor 16 Tagen
  • by default when creating a bucket (the public access is blocked)! I want an option to do the opposite thing, so I added --no-object-lock-enabled-for-bucket or even --object-lock-enabled-for-bucket (but it has no effect), the access remains blocked! (just try it et you will see: it is odd!) that with the AWS command line , this option is obselete (but still exsists in the documentation). To get a bucket wiht open public access (not blocked), I have to do 2 commands :

    $ aws s3api create-bucket --bucket abir-devops --region eu-west-3 --create-bucket-configuration LocationConstraint=eu-west-3 Then 2nd command (since by default the public access is blocked, when creating the bucket) $ aws s3api delete-public-access-block --bucket abir-devops ==> My question: whay this option is still in the documentation : ---no-object-lock-enabled-for-bucket or object-lock-enabled-for-bucket: but without any effect ! they are obselete!

  • Because S3 Object Lock is a different thing than Block Public Access. They do two different things.

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