boto3:使用禁用ACL的S3存储桶
我正在尝试使用Boto3和Python在S3上创建一个新的存储桶。但是,我希望其ACL被禁用。我已经尝试了以下代码,但是ACL仍然启用。如何使用boto3禁用ACL?
s3.create_bucket(
Bucket = BUCKET_NAME,
CreateBucketConfiguration = {
'LocationConstraint': REGION_NAME
},
ACL='private'
)
I am trying to create a new bucket on S3 using boto3 and python. However, I want its ACLs to be disabled. I have tried the following code, but ACLs are still enabled. How can I disable ACLs using boto3?
s3.create_bucket(
Bucket = BUCKET_NAME,
CreateBucketConfiguration = {
'LocationConstraint': REGION_NAME
},
ACL='private'
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
create_bucket SDK无法控制对象所有权。
我认为您需要指示
buckeTownerEnforced
在调用 put_bucket_ownhips_controls ,在创建了存储桶后。The create_bucket SDK does not control Object Ownership.
I think that you need to indicate the
BucketOwnerEnforced
rule when calling put_bucket_ownership_controls, after the bucket has been created.