Skip to content

(s3): Add support for BucketOwnerEnforced to S3 ObjectOwnership Type #17926

@mp365

Description

@mp365

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 :

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-s3Related to Amazon S3effort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.good first issueRelated to contributions. See CONTRIBUTING.mdp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions