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개 답변
0
수락된 답변

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
전문가
kentrad
답변함 10달 전
  • 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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠