Show / Hide Table of Contents

Enum ObjectOwnership

The ObjectOwnership of the bucket.

Namespace: Amazon.CDK.AWS.S3
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public enum ObjectOwnership
Syntax (vb)
Public Enum ObjectOwnership
Remarks

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

ExampleMetadata: infused

Examples
var accessLogsBucket = new Bucket(this, "AccessLogsBucket", new BucketProps {
                 ObjectOwnership = ObjectOwnership.BUCKET_OWNER_ENFORCED
             });

             accessLogsBucket.AddToResourcePolicy(
             new PolicyStatement(new PolicyStatementProps {
                 Actions = new [] { "s3:*" },
                 Resources = new [] { accessLogsBucket.BucketArn, accessLogsBucket.ArnForObjects("*") },
                 Principals = new [] { new AnyPrincipal() }
             }));

             var bucket = new Bucket(this, "MyBucket", new BucketProps {
                 ServerAccessLogsBucket = accessLogsBucket,
                 ServerAccessLogsPrefix = "logs"
             });

Synopsis

Fields

BUCKET_OWNER_ENFORCED

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

BUCKET_OWNER_PREFERRED

The bucket owner will own the object if the object is uploaded with the bucket-owner-full-control canned ACL.

OBJECT_WRITER

The uploading account will own the object.

Fields

Name Description
BUCKET_OWNER_ENFORCED

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

BUCKET_OWNER_PREFERRED

The bucket owner will own the object if the object is uploaded with the bucket-owner-full-control canned ACL.

OBJECT_WRITER

The uploading account will own the object.

Back to top Generated by DocFX