AWS::S3::Bucket OwnershipControls - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

AWS::S3::Bucket OwnershipControls

Specifies the container element for Object Ownership rules.

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 Amazon CloudFormation template, use the following syntax:

JSON

{ "Rules" : [ OwnershipControlsRule, ... ] }

Properties

Rules

Specifies the container element for Object Ownership rules.

Required: Yes

Type: Array of OwnershipControlsRule

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