-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(s3): Add support for BucketOwnerEnforced to S3 ObjectOwnership Type #17926
Description
Description
Object Ownership for an S3 bucket has three settings that you can use to control ownership of objects uploaded to a bucket and to disable or enable ACLs. The AWS recommended setting for object ownership is Bucker Owner Enforced. This is also reflected in the AWS S3 Console in the 'Edit Object Permissions' modal accessible from an S3 buckets 'Permissions' tab.
The CDK ObjectOwnership Type currently offers two of the options in its list of members.
The request is to add support for the third option BucketOwnerEnforced. This value is already available in the Cloud Formation AWS::S3::Bucket OwnershipControlsRule resource.
Use Case
Allow us to use the AWS recommended setting for S3 bucket object ownership when creating s3 buckets.
Proposed Solution
Add BucketOwnerEnforced to the bucket ObjectOwnership enum :
aws-cdk/packages/@aws-cdk/aws-s3/lib/bucket.ts
Lines 1173 to 1182 in dd5e12d
| export enum ObjectOwnership { | |
| /** | |
| * Objects uploaded to the bucket change ownership to the bucket owner . | |
| */ | |
| BUCKET_OWNER_PREFERRED = 'BucketOwnerPreferred', | |
| /** | |
| * The uploading account will own the object. | |
| */ | |
| OBJECT_WRITER = 'ObjectWriter', | |
| } |
Other information
No response
Acknowledge
- I may be able to implement this feature request
- This feature might incur a breaking change