Skip to content
v2.274.0

ObjectOwnership Enum ​

The ObjectOwnership of the bucket.

Example ​

ts
const accessLogsBucket = new s3.Bucket(this, 'AccessLogsBucket', {
  objectOwnership: s3.ObjectOwnership.BUCKET_OWNER_ENFORCED,
});

accessLogsBucket.addToResourcePolicy(
  new iam.PolicyStatement({
    actions: ['s3:*'],
    resources: [accessLogsBucket.bucketArn, accessLogsBucket.arnForObjects('*')],
    principals: [new iam.AnyPrincipal()],
  })
)

const bucket = new s3.Bucket(this, 'MyBucket', {
  serverAccessLogsBucket: accessLogsBucket,
  serverAccessLogsPrefix: 'logs',
});

Members ​

MemberDescription
BUCKET_OWNER_ENFORCEDACLs are disabled, and the bucket owner automatically owns and has full control over every object in the bucket.
BUCKET_OWNER_PREFERREDThe bucket owner will own the object if the object is uploaded with the bucket-owner-full-control canned ACL.
OBJECT_WRITERThe uploading account will own the object.

Referenced by ​

  • BucketBase.objectOwnershipobject_ownershipobjectOwnershipObjectOwnershipObjectOwnership
  • BucketProps.objectOwnershipobject_ownershipobjectOwnershipObjectOwnershipObjectOwnership