Support new Bucket Ownership Controls to ensure bucket owner owns all objects in the bucket
https://docs.aws.amazon.com/AmazonS3/latest/user-guide/add-object-ownership.html
Ensure proper object ownership after cross account writes
cdk.Bucket to support passing ownershipControls to CfnBucket
This is a :rocket: Feature Request
@relm-haven Can I take this up?
@saudkhanzada please do!
Please suggest between these two approaches:
new s3.Bucket(stack, 'MyBucket', {
ownershipControls: {
rules: [{
objectOwnership: s3.ObjectOwnership.BUCKET_OWNER_PREFERRED,
}],
},
});
new s3.Bucket(stack, 'MyBucket', {
objectOwnership: s3.ObjectOwnership.BUCKET_OWNER_PREFERRED,
});
Personally, I am going for the second one as recommended by the design guide.
Approach 2 looks cleaner to me
I know CloudFormation supports a list of rules but what is the use case for more than one rule?
I'm not sure of the use case but I'd vote to retain the array to allow for such use cases now or in the future when those uses cases might reveal themselves:
new s3.Bucket(stack, 'MyBucket', {
objectOwnership: [s3.ObjectOwnership.RULE_BUCKET_OWNER_PREFERRED]
});
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Most helpful comment
I'm not sure of the use case but I'd vote to retain the array to allow for such use cases now or in the future when those uses cases might reveal themselves: