aws-cdk-lib.aws_s3.ObjectOwnership

enum ObjectOwnership

LanguageType name
.NETAmazon.CDK.AWS.S3.ObjectOwnership
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awss3#ObjectOwnership
Javasoftware.amazon.awscdk.services.s3.ObjectOwnership
Pythonaws_cdk.aws_s3.ObjectOwnership
TypeScript (source)aws-cdk-lib » aws_s3 » ObjectOwnership

The ObjectOwnership of the bucket.

See also: https://docs.aws.amazon.com/AmazonS3/latest/dev/about-object-ownership.html

Example

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

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

Members

NameDescription
BUCKET_OWNER_ENFORCEDACLs are disabled, and the bucket owner automatically owns and has full control over every object in the bucket.
BUCKET_OWNER_PREFERREDObjects uploaded to the bucket change ownership to the bucket owner .
OBJECT_WRITERThe uploading account will own the object.

BUCKET_OWNER_ENFORCED

ACLs are disabled, and the bucket owner automatically owns and has full control over every object in the bucket.

ACLs no longer affect permissions to data in the S3 bucket. The bucket uses policies to define access control.


BUCKET_OWNER_PREFERRED

Objects uploaded to the bucket change ownership to the bucket owner .


OBJECT_WRITER

The uploading account will own the object.