Class ObjectOwnership
The ObjectOwnership of the bucket.
Inheritance
Namespace: Amazon.CDK.AWS.S3
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public sealed class ObjectOwnership : Enum
Syntax (vb)
Public NotInheritable Class ObjectOwnership
Inherits
Enum
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. |
value__ |
Fields
BUCKET_OWNER_ENFORCED
ACLs are disabled, and the bucket owner automatically owns and has full control over every object in the bucket.
public const ObjectOwnership BUCKET_OWNER_ENFORCED
Field Value
Type | Description |
---|---|
ObjectOwnership |
Remarks
ACLs no longer affect permissions to data in the S3 bucket. The bucket uses policies to define access control.
BUCKET_OWNER_PREFERRED
The bucket owner will own the object if the object is uploaded with the bucket-owner-full-control canned ACL.
public const ObjectOwnership BUCKET_OWNER_PREFERRED
Field Value
Type | Description |
---|---|
ObjectOwnership |
Remarks
Without this setting and canned ACL, the object is uploaded and remains owned by the uploading account.
OBJECT_WRITER
The uploading account will own the object.
public const ObjectOwnership OBJECT_WRITER
Field Value
Type | Description |
---|---|
ObjectOwnership |
value__
public int value__
Field Value
Type | Description |
---|---|
System.Int32 |