AWS::S3::Bucket OwnershipControlsRule - AWS CloudFormation

AWS::S3::Bucket OwnershipControlsRule

Specifies an Object Ownership rule.

S3 Object Ownership is an Amazon S3 bucket-level setting that you can use to disable access control lists (ACLs) and take ownership of every object in your bucket, simplifying access management for data stored in Amazon S3. For more information, see Controlling ownership of objects and disabling ACLs in the Amazon S3 User Guide.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "ObjectOwnership" : String }

YAML

ObjectOwnership: String

Properties

ObjectOwnership

Specifies an object ownership rule.

Required: No

Type: String

Allowed values: ObjectWriter | BucketOwnerPreferred | BucketOwnerEnforced

Update requires: No interruption

Examples

Object Ownership - BucketOwnerEnforced

The following examples show Object Ownership set to BucketOwnerEnforced.

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "S3Bucket": { "Type": "AWS::S3::Bucket", "Properties": { "OwnershipControls": { "Rules": [ { "ObjectOwnership": "BucketOwnerEnforced" } ] } } } } }

YAML

AWSTemplateFormatVersion: 2010-09-09 Resources: S3Bucket: Type: 'AWS::S3::Bucket' Properties: OwnershipControls: Rules: - ObjectOwnership: BucketOwnerEnforced

Object Ownership - BucketOwnerPreferred

The following examples show Object Ownership set to BucketOwnerPreferred.

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "S3Bucket": { "Type": "AWS::S3::Bucket", "Properties": { "OwnershipControls": { "Rules": [ { "ObjectOwnership": "BucketOwnerPreferred" } ] } } } } }

YAML

AWSTemplateFormatVersion: 2010-09-09 Resources: S3Bucket: Type: 'AWS::S3::Bucket' Properties: OwnershipControls: Rules: - ObjectOwnership: BucketOwnerPreferred