

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::S3::Bucket
<a name="aws-resource-s3-bucket"></a>

The `AWS::S3::Bucket` resource creates an Amazon S3 bucket in the same AWS Region where you create the AWS CloudFormation stack.

To control how AWS CloudFormation handles the bucket when the stack is deleted, you can set a deletion policy for your bucket. You can choose to *retain* the bucket or to *delete* the bucket. For more information, see [DeletionPolicy Attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html).

**Important**  
You can only delete empty buckets. Deletion fails for buckets that have contents.

## Syntax
<a name="aws-resource-s3-bucket-syntax"></a>

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

### JSON
<a name="aws-resource-s3-bucket-syntax.json"></a>

```
{
  "Type" : "AWS::S3::Bucket",
  "Properties" : {
      "[AbacStatus](#cfn-s3-bucket-abacstatus)" : String,
      "[AccelerateConfiguration](#cfn-s3-bucket-accelerateconfiguration)" : AccelerateConfiguration,
      "[AccessControl](#cfn-s3-bucket-accesscontrol)" : String,
      "[AnalyticsConfigurations](#cfn-s3-bucket-analyticsconfigurations)" : [ AnalyticsConfiguration, ... ],
      "[BucketEncryption](#cfn-s3-bucket-bucketencryption)" : BucketEncryption,
      "[BucketName](#cfn-s3-bucket-bucketname)" : String,
      "[BucketNamePrefix](#cfn-s3-bucket-bucketnameprefix)" : String,
      "[BucketNamespace](#cfn-s3-bucket-bucketnamespace)" : String,
      "[CorsConfiguration](#cfn-s3-bucket-corsconfiguration)" : CorsConfiguration,
      "[IntelligentTieringConfigurations](#cfn-s3-bucket-intelligenttieringconfigurations)" : [ IntelligentTieringConfiguration, ... ],
      "[InventoryConfigurations](#cfn-s3-bucket-inventoryconfigurations)" : [ InventoryConfiguration, ... ],
      "[LifecycleConfiguration](#cfn-s3-bucket-lifecycleconfiguration)" : LifecycleConfiguration,
      "[LoggingConfiguration](#cfn-s3-bucket-loggingconfiguration)" : LoggingConfiguration,
      "[MetadataConfiguration](#cfn-s3-bucket-metadataconfiguration)" : MetadataConfiguration,
      "[MetadataTableConfiguration](#cfn-s3-bucket-metadatatableconfiguration)" : MetadataTableConfiguration,
      "[MetricsConfigurations](#cfn-s3-bucket-metricsconfigurations)" : [ MetricsConfiguration, ... ],
      "[NotificationConfiguration](#cfn-s3-bucket-notificationconfiguration)" : NotificationConfiguration,
      "[ObjectLockConfiguration](#cfn-s3-bucket-objectlockconfiguration)" : ObjectLockConfiguration,
      "[ObjectLockEnabled](#cfn-s3-bucket-objectlockenabled)" : Boolean,
      "[OwnershipControls](#cfn-s3-bucket-ownershipcontrols)" : OwnershipControls,
      "[PublicAccessBlockConfiguration](#cfn-s3-bucket-publicaccessblockconfiguration)" : PublicAccessBlockConfiguration,
      "[ReplicationConfiguration](#cfn-s3-bucket-replicationconfiguration)" : ReplicationConfiguration,
      "[Tags](#cfn-s3-bucket-tags)" : [ Tag, ... ],
      "[VersioningConfiguration](#cfn-s3-bucket-versioningconfiguration)" : VersioningConfiguration,
      "[WebsiteConfiguration](#cfn-s3-bucket-websiteconfiguration)" : WebsiteConfiguration
    }
}
```

### YAML
<a name="aws-resource-s3-bucket-syntax.yaml"></a>

```
Type: AWS::S3::Bucket
Properties:
  [AbacStatus](#cfn-s3-bucket-abacstatus): String
  [AccelerateConfiguration](#cfn-s3-bucket-accelerateconfiguration): 
    AccelerateConfiguration
  [AccessControl](#cfn-s3-bucket-accesscontrol): String
  [AnalyticsConfigurations](#cfn-s3-bucket-analyticsconfigurations): 
    - AnalyticsConfiguration
  [BucketEncryption](#cfn-s3-bucket-bucketencryption): 
    BucketEncryption
  [BucketName](#cfn-s3-bucket-bucketname): String
  [BucketNamePrefix](#cfn-s3-bucket-bucketnameprefix): String
  [BucketNamespace](#cfn-s3-bucket-bucketnamespace): String
  [CorsConfiguration](#cfn-s3-bucket-corsconfiguration): 
    CorsConfiguration
  [IntelligentTieringConfigurations](#cfn-s3-bucket-intelligenttieringconfigurations): 
    - IntelligentTieringConfiguration
  [InventoryConfigurations](#cfn-s3-bucket-inventoryconfigurations): 
    - InventoryConfiguration
  [LifecycleConfiguration](#cfn-s3-bucket-lifecycleconfiguration): 
    LifecycleConfiguration
  [LoggingConfiguration](#cfn-s3-bucket-loggingconfiguration): 
    LoggingConfiguration
  [MetadataConfiguration](#cfn-s3-bucket-metadataconfiguration): 
    MetadataConfiguration
  [MetadataTableConfiguration](#cfn-s3-bucket-metadatatableconfiguration): 
    MetadataTableConfiguration
  [MetricsConfigurations](#cfn-s3-bucket-metricsconfigurations): 
    - MetricsConfiguration
  [NotificationConfiguration](#cfn-s3-bucket-notificationconfiguration): 
    NotificationConfiguration
  [ObjectLockConfiguration](#cfn-s3-bucket-objectlockconfiguration): 
    ObjectLockConfiguration
  [ObjectLockEnabled](#cfn-s3-bucket-objectlockenabled): Boolean
  [OwnershipControls](#cfn-s3-bucket-ownershipcontrols): 
    OwnershipControls
  [PublicAccessBlockConfiguration](#cfn-s3-bucket-publicaccessblockconfiguration): 
    PublicAccessBlockConfiguration
  [ReplicationConfiguration](#cfn-s3-bucket-replicationconfiguration): 
    ReplicationConfiguration
  [Tags](#cfn-s3-bucket-tags): 
    - Tag
  [VersioningConfiguration](#cfn-s3-bucket-versioningconfiguration): 
    VersioningConfiguration
  [WebsiteConfiguration](#cfn-s3-bucket-websiteconfiguration): 
    WebsiteConfiguration
```

## Properties
<a name="aws-resource-s3-bucket-properties"></a>

`AbacStatus`  <a name="cfn-s3-bucket-abacstatus"></a>
The ABAC status of the general purpose bucket. When ABAC is enabled for the general purpose bucket, you can use tags to manage access to the general purpose buckets as well as for cost tracking purposes. When ABAC is disabled for the general purpose buckets, you can only use tags for cost tracking purposes. For more information, see [Using tags with S3 general purpose buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/buckets-tagging.html).   
*Required*: No  
*Type*: String  
*Allowed values*: `Enabled | Disabled`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AccelerateConfiguration`  <a name="cfn-s3-bucket-accelerateconfiguration"></a>
Configures the transfer acceleration state for an Amazon S3 bucket. For more information, see [Amazon S3 Transfer Acceleration](https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html) in the *Amazon S3 User Guide*.  
*Required*: No  
*Type*: [AccelerateConfiguration](aws-properties-s3-bucket-accelerateconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AccessControl`  <a name="cfn-s3-bucket-accesscontrol"></a>
 This is a legacy property, and it is not recommended for most use cases. A majority of modern use cases in Amazon S3 no longer require the use of ACLs, and we recommend that you keep ACLs disabled. For more information, see [Controlling object ownership](https://docs.aws.amazon.com//AmazonS3/latest/userguide/about-object-ownership.html) in the *Amazon S3 User Guide*.
A canned access control list (ACL) that grants predefined permissions to the bucket. For more information about canned ACLs, see [Canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl) in the *Amazon S3 User Guide*.  
 S3 buckets are created with ACLs disabled by default. Therefore, unless you explicitly set the [AWS::S3::OwnershipControls](https://docs.aws.amazon.com//AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-ownershipcontrols.html) property to enable ACLs, your resource will fail to deploy with any value other than Private. Use cases requiring ACLs are uncommon.  
 The majority of access control configurations can be successfully and more easily achieved with bucket policies. For more information, see [AWS::S3::BucketPolicy](https://docs.aws.amazon.com//AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html). For examples of common policy configurations, including S3 Server Access Logs buckets and more, see [Bucket policy examples](https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html) in the *Amazon S3 User Guide*.  
*Required*: No  
*Type*: String  
*Allowed values*: `AuthenticatedRead | AwsExecRead | BucketOwnerFullControl | BucketOwnerRead | LogDeliveryWrite | Private | PublicRead | PublicReadWrite`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AnalyticsConfigurations`  <a name="cfn-s3-bucket-analyticsconfigurations"></a>
Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket.  
*Required*: No  
*Type*: Array of [AnalyticsConfiguration](aws-properties-s3-bucket-analyticsconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`BucketEncryption`  <a name="cfn-s3-bucket-bucketencryption"></a>
Specifies default encryption for a bucket using server-side encryption with Amazon S3-managed keys (SSE-S3), AWS KMS-managed keys (SSE-KMS), or dual-layer server-side encryption with KMS-managed keys (DSSE-KMS). For information about the Amazon S3 default encryption feature, see [Amazon S3 Default Encryption for S3 Buckets](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) in the *Amazon S3 User Guide*.  
*Required*: No  
*Type*: [BucketEncryption](aws-properties-s3-bucket-bucketencryption.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`BucketName`  <a name="cfn-s3-bucket-bucketname"></a>
A name for the bucket. If you don't specify a name, AWS CloudFormation generates a unique ID and uses that ID for the bucket name. The bucket name must contain only lowercase letters, numbers, periods (.), and dashes (-) and must follow [Amazon S3 bucket restrictions and limitations](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html). For more information, see [Rules for naming Amazon S3 buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html) in the *Amazon S3 User Guide*.   
If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you need to replace the resource, specify a new name.
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`BucketNamePrefix`  <a name="cfn-s3-bucket-bucketnameprefix"></a>
Property description not available.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`BucketNamespace`  <a name="cfn-s3-bucket-bucketnamespace"></a>
Property description not available.  
*Required*: No  
*Type*: String  
*Allowed values*: `global | account-regional`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`CorsConfiguration`  <a name="cfn-s3-bucket-corsconfiguration"></a>
Describes the cross-origin access configuration for objects in an Amazon S3 bucket. For more information, see [Enabling Cross-Origin Resource Sharing](https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the *Amazon S3 User Guide*.  
*Required*: No  
*Type*: [CorsConfiguration](aws-properties-s3-bucket-corsconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`IntelligentTieringConfigurations`  <a name="cfn-s3-bucket-intelligenttieringconfigurations"></a>
Defines how Amazon S3 handles Intelligent-Tiering storage.  
*Required*: No  
*Type*: Array of [IntelligentTieringConfiguration](aws-properties-s3-bucket-intelligenttieringconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`InventoryConfigurations`  <a name="cfn-s3-bucket-inventoryconfigurations"></a>
Specifies the S3 Inventory configuration for an Amazon S3 bucket. For more information, see [GET Bucket inventory](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETInventoryConfig.html) in the *Amazon S3 API Reference*.   
*Required*: No  
*Type*: Array of [InventoryConfiguration](aws-properties-s3-bucket-inventoryconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`LifecycleConfiguration`  <a name="cfn-s3-bucket-lifecycleconfiguration"></a>
Specifies the lifecycle configuration for objects in an Amazon S3 bucket. For more information, see [Object Lifecycle Management](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) in the *Amazon S3 User Guide*.  
*Required*: No  
*Type*: [LifecycleConfiguration](aws-properties-s3-bucket-lifecycleconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`LoggingConfiguration`  <a name="cfn-s3-bucket-loggingconfiguration"></a>
Settings that define where logs are stored.  
*Required*: No  
*Type*: [LoggingConfiguration](aws-properties-s3-bucket-loggingconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MetadataConfiguration`  <a name="cfn-s3-bucket-metadataconfiguration"></a>
 The S3 Metadata configuration for a general purpose bucket.   
*Required*: No  
*Type*: [MetadataConfiguration](aws-properties-s3-bucket-metadataconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MetadataTableConfiguration`  <a name="cfn-s3-bucket-metadatatableconfiguration"></a>
 The metadata table configuration of an Amazon S3 general purpose bucket.   
*Required*: No  
*Type*: [MetadataTableConfiguration](aws-properties-s3-bucket-metadatatableconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MetricsConfigurations`  <a name="cfn-s3-bucket-metricsconfigurations"></a>
Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket. If you're updating an existing metrics configuration, note that this is a full replacement of the existing metrics configuration. If you don't include the elements you want to keep, they are erased. For more information, see [PutBucketMetricsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTMetricConfiguration.html).  
*Required*: No  
*Type*: Array of [MetricsConfiguration](aws-properties-s3-bucket-metricsconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`NotificationConfiguration`  <a name="cfn-s3-bucket-notificationconfiguration"></a>
Configuration that defines how Amazon S3 handles bucket notifications.  
*Required*: No  
*Type*: [NotificationConfiguration](aws-properties-s3-bucket-notificationconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ObjectLockConfiguration`  <a name="cfn-s3-bucket-objectlockconfiguration"></a>
This operation is not supported for directory buckets.
Places an Object Lock configuration on the specified bucket. The rule specified in the Object Lock configuration will be applied by default to every new object placed in the specified bucket. For more information, see [Locking Objects](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html).   
+ The `DefaultRetention` settings require both a mode and a period.
+ The `DefaultRetention` period can be either `Days` or `Years` but you must select one. You cannot specify `Days` and `Years` at the same time.
+ You can enable Object Lock for new or existing buckets. For more information, see [Configuring Object Lock](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-configure.html).
You must URL encode any signed header values that contain spaces. For example, if your header value is `my file.txt`, containing two spaces after `my`, you must URL encode this value to `my%20%20file.txt`.
*Required*: No  
*Type*: [ObjectLockConfiguration](aws-properties-s3-bucket-objectlockconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ObjectLockEnabled`  <a name="cfn-s3-bucket-objectlockenabled"></a>
Indicates whether this bucket has an Object Lock configuration enabled. Enable `ObjectLockEnabled` when you apply `ObjectLockConfiguration` to a bucket.   
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`OwnershipControls`  <a name="cfn-s3-bucket-ownershipcontrols"></a>
Configuration that defines how Amazon S3 handles Object Ownership rules.  
*Required*: No  
*Type*: [OwnershipControls](aws-properties-s3-bucket-ownershipcontrols.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`PublicAccessBlockConfiguration`  <a name="cfn-s3-bucket-publicaccessblockconfiguration"></a>
Configuration that defines how Amazon S3 handles public access.  
*Required*: No  
*Type*: [PublicAccessBlockConfiguration](aws-properties-s3-bucket-publicaccessblockconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ReplicationConfiguration`  <a name="cfn-s3-bucket-replicationconfiguration"></a>
Configuration for replicating objects in an S3 bucket. To enable replication, you must also enable versioning by using the `VersioningConfiguration` property.  
Amazon S3 can store replicated objects in a single destination bucket or multiple destination buckets. The destination bucket or buckets must already exist.  
*Required*: No  
*Type*: [ReplicationConfiguration](aws-properties-s3-bucket-replicationconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-s3-bucket-tags"></a>
An arbitrary set of tags (key-value pairs) for this S3 bucket.  
*Required*: No  
*Type*: Array of [Tag](aws-properties-s3-bucket-tag.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`VersioningConfiguration`  <a name="cfn-s3-bucket-versioningconfiguration"></a>
Enables multiple versions of all objects in this bucket. You might enable versioning to prevent objects from being deleted or overwritten by mistake or to archive objects so that you can retrieve previous versions of them.  
When you enable versioning on a bucket for the first time, it might take a short amount of time for the change to be fully propagated. We recommend that you wait for 15 minutes after enabling versioning before issuing write operations (`PUT` or `DELETE`) on objects in the bucket. 
*Required*: No  
*Type*: [VersioningConfiguration](aws-properties-s3-bucket-versioningconfiguration.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`WebsiteConfiguration`  <a name="cfn-s3-bucket-websiteconfiguration"></a>
Information used to configure the bucket as a static website. For more information, see [Hosting Websites on Amazon S3](https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html).  
*Required*: No  
*Type*: [WebsiteConfiguration](aws-properties-s3-bucket-websiteconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-s3-bucket-return-values"></a>

### Ref
<a name="aws-resource-s3-bucket-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the bucket name.

Example: ` amzn-s3-demo-bucket `

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-s3-bucket-return-values-fn--getatt"></a>

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-s3-bucket-return-values-fn--getatt-fn--getatt"></a>

`Arn`  <a name="Arn-fn::getatt"></a>
Returns the Amazon Resource Name (ARN) of the specified bucket.  
Example: `arn:aws:s3:::DOC-EXAMPLE-BUCKET`

`DomainName`  <a name="DomainName-fn::getatt"></a>
Returns the IPv4 DNS name of the specified bucket.  
Example: `DOC-EXAMPLE-BUCKET.s3.amazonaws.com`

`DualStackDomainName`  <a name="DualStackDomainName-fn::getatt"></a>
Returns the IPv6 DNS name of the specified bucket.  
Example: ` DOC-EXAMPLE-BUCKET.s3.dualstack.us-east-2.amazonaws.com`  
For more information about dual-stack endpoints, see [Using Amazon S3 Dual-Stack Endpoints](https://docs.aws.amazon.com/AmazonS3/latest/dev/dual-stack-endpoints.html).

`MetadataConfiguration.InventoryTableConfiguration.TableArn`  <a name="MetadataConfiguration.InventoryTableConfiguration.TableArn-fn::getatt"></a>
Property description not available.

`MetadataConfiguration.InventoryTableConfiguration.TableName`  <a name="MetadataConfiguration.InventoryTableConfiguration.TableName-fn::getatt"></a>
Property description not available.

`MetadataConfiguration.JournalTableConfiguration.TableArn`  <a name="MetadataConfiguration.JournalTableConfiguration.TableArn-fn::getatt"></a>
Property description not available.

`MetadataConfiguration.JournalTableConfiguration.TableName`  <a name="MetadataConfiguration.JournalTableConfiguration.TableName-fn::getatt"></a>
Property description not available.

`MetadataTableConfiguration.S3TablesDestination.TableArn`  <a name="MetadataTableConfiguration.S3TablesDestination.TableArn-fn::getatt"></a>
The Amazon Resource Name (ARN) for the metadata table in the metadata table configuration. The specified metadata table name must be unique within the `aws_s3_metadata` namespace in the destination table bucket.  
Example: `arn:aws:s3tables:region:account-id:bucket/amzn-s3-demo-bucket/table/1234567890abcdef0`

`MetadataTableConfiguration.S3TablesDestination.TableNamespace`  <a name="MetadataTableConfiguration.S3TablesDestination.TableNamespace-fn::getatt"></a>
The table bucket namespace for the metadata table in the specified bucket's metadata table configuration. This value is always `aws_s3_metadata`.

`RegionalDomainName`  <a name="RegionalDomainName-fn::getatt"></a>
Returns the regional domain name of the specified bucket.  
Example: `DOC-EXAMPLE-BUCKET.s3.us-east-2.amazonaws.com`

`WebsiteURL`  <a name="WebsiteURL-fn::getatt"></a>
Returns the Amazon S3 website endpoint for the specified bucket.  
Example (IPv4): `http://DOC-EXAMPLE-BUCKET.s3-website.us-east-2.amazonaws.com`  
Example (IPv6): `http://DOC-EXAMPLE-BUCKET.s3.dualstack.us-east-2.amazonaws.com`

## Examples
<a name="aws-resource-s3-bucket--examples"></a>



**Topics**
+ [Create an S3 bucket](#aws-resource-s3-bucket--examples--Create_an_S3_bucket)
+ [Associate a replication configuration IAM role with an S3 bucket](#aws-resource-s3-bucket--examples--Associate_a_replication_configuration_IAM_role_with_an_S3_bucket)
+ [Granting public access to S3 buckets](#aws-resource-s3-bucket--examples--Granting_public_access_to_S3_buckets)
+ [Enabling ACLs](#aws-resource-s3-bucket--examples--Enabling_ACLs)
+ [Configure a static website with a routing rule](#aws-resource-s3-bucket--examples--Configure_a_static_website_with_a_routing_rule)
+ [Enable cross-origin resource sharing](#aws-resource-s3-bucket--examples--Enable_cross-origin_resource_sharing)
+ [Manage the lifecycle for S3 objects](#aws-resource-s3-bucket--examples--Manage_the_lifecycle_for_S3_objects)
+ [Log access requests for a specific S3 bucket](#aws-resource-s3-bucket--examples--Log_access_requests_for_a_specific_S3_bucket)
+ [Receive S3 bucket notifications to an SNS topic](#aws-resource-s3-bucket--examples--Receive_S3_bucket_notifications_to_an_SNS_topic)
+ [Enable versioning and replicate objects](#aws-resource-s3-bucket--examples--Enable_versioning_and_replicate_objects)
+ [Specify analytics and inventory configurations for an S3 bucket](#aws-resource-s3-bucket--examples--Specify_analytics_and_inventory_configurations_for_an_S3_bucket)

### Create an S3 bucket
<a name="aws-resource-s3-bucket--examples--Create_an_S3_bucket"></a>

The following example creates an S3 bucket with a `Retain` deletion policy.

#### JSON
<a name="aws-resource-s3-bucket--examples--Create_an_S3_bucket--json"></a>

```
{
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "DeletionPolicy": "Retain",
            "Properties": {
                "BucketName": "DOC-EXAMPLE-BUCKET"
            }
        }
    }
}
```

#### YAML
<a name="aws-resource-s3-bucket--examples--Create_an_S3_bucket--yaml"></a>

```
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    DeletionPolicy: Retain
    Properties:
      BucketName: DOC-EXAMPLE-BUCKET
```

### Associate a replication configuration IAM role with an S3 bucket
<a name="aws-resource-s3-bucket--examples--Associate_a_replication_configuration_IAM_role_with_an_S3_bucket"></a>

The following example creates an S3 bucket and grants it permission to write to a replication bucket by using an AWS Identity and Access Management (IAM) role. To avoid a circular dependency, the role's policy is declared as a separate resource. The bucket depends on the `WorkItemBucketBackupRole` role. If the policy is included in the role, the role also depends on the bucket.

#### JSON
<a name="aws-resource-s3-bucket--examples--Associate_a_replication_configuration_IAM_role_with_an_S3_bucket--json"></a>

```
{
    "Resources": {
        "RecordServiceS3Bucket": {
            "Type": "AWS::S3::Bucket",
            "DeletionPolicy": "Retain",
            "Properties": {
                "ReplicationConfiguration": {
                    "Role": {
                        "Fn::GetAtt": [
                            "WorkItemBucketBackupRole",
                            "Arn"
                        ]
                    },
                    "Rules": [
                        {
                            "Destination": {
                                "Bucket": {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "arn:aws:s3:::",
                                            {
                                                "Fn::Join": [
                                                    "-",
                                                    [
                                                        {
                                                            "Ref": "AWS::Region"
                                                        },
                                                        {
                                                            "Ref": "AWS::StackName"
                                                        },
                                                        "replicationbucket"
                                                    ]
                                                ]
                                            }
                                        ]
                                    ]
                                },
                                "StorageClass": "STANDARD"
                            },
                            "Id": "Backup",
                            "Prefix": "",
                            "Status": "Enabled"
                        }
                    ]
                },
                "VersioningConfiguration": {
                    "Status": "Enabled"
                }
            }
        },
        "WorkItemBucketBackupRole": {
            "Type": "AWS::IAM::Role",
            "Properties": {
                "AssumeRolePolicyDocument": {
                    "Statement": [
                        {
                            "Action": [
                                "sts:AssumeRole"
                            ],
                            "Effect": "Allow",
                            "Principal": {
                                "Service": [
                                    "s3.amazonaws.com"
                                ]
                            }
                        }
                    ]
                }
            }
        },
        "BucketBackupPolicy": {
            "Type": "AWS::IAM::Policy",
            "Properties": {
                "PolicyDocument": {
                    "Statement": [
                        {
                            "Action": [
                                "s3:GetReplicationConfiguration",
                                "s3:ListBucket"
                            ],
                            "Effect": "Allow",
                            "Resource": [
                                {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "arn:aws:s3:::",
                                            {
                                                "Ref": "RecordServiceS3Bucket"
                                            }
                                        ]
                                    ]
                                }
                            ]
                        },
                        {
                            "Action": [
                                "s3:GetObjectVersion",
                                "s3:GetObjectVersionAcl"
                            ],
                            "Effect": "Allow",
                            "Resource": [
                                {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "arn:aws:s3:::",
                                            {
                                                "Ref": "RecordServiceS3Bucket"
                                            },
                                            "/*"
                                        ]
                                    ]
                                }
                            ]
                        },
                        {
                            "Action": [
                                "s3:ReplicateObject",
                                "s3:ReplicateDelete"
                            ],
                            "Effect": "Allow",
                            "Resource": [
                                {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "arn:aws:s3:::",
                                            {
                                                "Fn::Join": [
                                                    "-",
                                                    [
                                                        {
                                                            "Ref": "AWS::Region"
                                                        },
                                                        {
                                                            "Ref": "AWS::StackName"
                                                        },
                                                        "replicationbucket"
                                                    ]
                                                ]
                                            },
                                            "/*"
                                        ]
                                    ]
                                }
                            ]
                        }
                    ]
                },
                "PolicyName": "BucketBackupPolicy",
                "Roles": [
                    {
                        "Ref": "WorkItemBucketBackupRole"
                    }
                ]
            }
        }
    }
}
```

#### YAML
<a name="aws-resource-s3-bucket--examples--Associate_a_replication_configuration_IAM_role_with_an_S3_bucket--yaml"></a>

```
Resources:
  RecordServiceS3Bucket:
    Type: 'AWS::S3::Bucket'
    DeletionPolicy: Retain
    Properties:
      ReplicationConfiguration:
        Role: !GetAtt
          - WorkItemBucketBackupRole
          - Arn
        Rules:
          - Destination:
              Bucket: !Join
                - ''
                - - 'arn:aws:s3:::'
                  - !Join
                    - '-'
                    - - !Ref 'AWS::Region'
                      - !Ref 'AWS::StackName'
                      - replicationbucket
              StorageClass: STANDARD
            Id: Backup
            Prefix: ''
            Status: Enabled
      VersioningConfiguration:
        Status: Enabled
  WorkItemBucketBackupRole:
    Type: 'AWS::IAM::Role'
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Action:
              - 'sts:AssumeRole'
            Effect: Allow
            Principal:
              Service:
                - s3.amazonaws.com
  BucketBackupPolicy:
    Type: 'AWS::IAM::Policy'
    Properties:
      PolicyDocument:
        Statement:
          - Action:
              - 's3:GetReplicationConfiguration'
              - 's3:ListBucket'
            Effect: Allow
            Resource:
              - !Join
                - ''
                - - 'arn:aws:s3:::'
                  - !Ref RecordServiceS3Bucket
          - Action:
              - 's3:GetObjectVersion'
              - 's3:GetObjectVersionAcl'
            Effect: Allow
            Resource:
              - !Join
                - ''
                - - 'arn:aws:s3:::'
                  - !Ref RecordServiceS3Bucket
                  - /*
          - Action:
              - 's3:ReplicateObject'
              - 's3:ReplicateDelete'
            Effect: Allow
            Resource:
              - !Join
                - ''
                - - 'arn:aws:s3:::'
                  - !Join
                    - '-'
                    - - !Ref 'AWS::Region'
                      - !Ref 'AWS::StackName'
                      - replicationbucket
                  - /*
      PolicyName: BucketBackupPolicy
      Roles:
        - !Ref WorkItemBucketBackupRole
```

### Granting public access to S3 buckets
<a name="aws-resource-s3-bucket--examples--Granting_public_access_to_S3_buckets"></a>

When you create a new bucket, all Block Public Access settings are automatically enabled. We recommend that you keep all Block Public Access settings enabled. If you require some level of public access to your buckets, you can disable Block Public Access settings. The following example shows creating a bucket called `my-bucket` and then disabling Block Public Access. A public bucket policy is then added to the bucket. 

**Note**  
The following example assumes the `BlockPublicPolicy` and `RestrictPublicBuckets` Block Public Access settings have been disabled at the account level. 

#### JSON
<a name="aws-resource-s3-bucket--examples--Granting_public_access_to_S3_buckets--json"></a>

```
        {
          "Resources": {
            "MyBucket": {
              "Type": "AWS::S3::Bucket",
              "Properties": {
                "BucketName": "my-bucket",
                "PublicAccessBlockConfiguration": {
                  "BlockPublicAcls": false,
                  "BlockPublicPolicy": false,
                  "IgnorePublicAcls": false,
                  "RestrictPublicBuckets": false
                  
                }
              }
            },
            "MyBucketPolicy": {
              "Type": "AWS::S3::BucketPolicy",
              "Properties": {
                "Bucket": {
                  "Ref": "MyBucket"
                },
                "PolicyDocument": {
                  "Version": "2012-10-17",		 	 	 
                  "Statement": [
                    {
                       "Effect": "Allow",
                       "Principal": "*",
                       "Action": "s3:GetObject",
                       "Resource": {
                         "Fn::Join": [
                           "",
                           [
                             "arn:aws:s3:::",
                             {
                               "Ref": "MyBucket"
                             },
                             "/*"
                           ]
                         ]
                       }
                     }
                   ]
                 }
               }
             }
           }
         }
```

#### YAML
<a name="aws-resource-s3-bucket--examples--Granting_public_access_to_S3_buckets--yaml"></a>

```
        Resources:
          MyBucket:
            Type: 'AWS::S3::Bucket'
            Properties:
              BucketName: my-bucket
              PublicAccessBlockConfiguration:
                BlockPublicAcls: false
                BlockPublicPolicy: false
                IgnorePublicAcls: false
                RestrictPublicBuckets: false
          MyBucketPolicy:
            Type: 'AWS::S3::BucketPolicy'
            Properties:
              Bucket:
                Ref: 'MyBucket'
              PolicyDocument:
                Version: '2012-10-17		 	 	 '
                Statement:
                  - Effect: Allow
                    Principal: '*'
                    Action: 's3:GetObject'
                    Resource:
                      Fn::Join:
                        - ''
                        - - 'arn:aws:s3:::'
                          - Ref: 'MyBucket'
                          - '/*'
```

### Enabling ACLs
<a name="aws-resource-s3-bucket--examples--Enabling_ACLs"></a>

 By default, S3 Object Ownership is set to `BucketOwnerEnforced` and ACLs are disabled. A majority of modern use cases in S3 no longer require the use of ACLs, and we recommend that you keep ACLs disabled. With ACLs disabled, you can control access to all objects in your bucket, regardless of who uploaded the objects to your bucket. If your specific use case requires enabling ACLs, you can set S3 Object Ownership to `BucketOwnerPreferred` or `ObjectWriter`. For more information, see [Controlling ownership of objects and disabling ACLs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) in the *Amazon S3 User Guide*. 

The following example shows Object Ownership set to `BucketOwnerPreferred`. 

#### JSON
<a name="aws-resource-s3-bucket--examples--Enabling_ACLs--json"></a>

```
        {
          "Resources": {
            "MyBucket": {
              "Type": "AWS::S3::Bucket",
              "Properties": {
                "BucketName": "my-bucket",
                "OwnershipControls": {
                       "Rules": [
                           {
                               "ObjectOwnership": "BucketOwnerPreferred"
                           }
                       ]
                   },
                "AccessControl": "AwsExecRead"
              }
           }
         }
       }
```

#### YAML
<a name="aws-resource-s3-bucket--examples--Enabling_ACLs--yaml"></a>

```
        Resources:
          MyBucket:
            Type: 'AWS::S3::Bucket'
            Properties:
              BucketName: my-bucket
              OwnershipControls:
                Rules:
                - ObjectOwnership: BucketOwnerPreferred
              AccessControl: AwsExecRead
```

### Configure a static website with a routing rule
<a name="aws-resource-s3-bucket--examples--Configure_a_static_website_with_a_routing_rule"></a>

In this example, `AWS::S3::Bucket's Fn::GetAtt` values are used to provide outputs. If an HTTP 404 error occurs, the routing rule redirects requests to an EC2 instance and inserts the object key prefix `report-404/` in the redirect. For example, if you request a page called `out1/ExamplePage.html` and it results in an HTTP 404 error, the request is routed to a page called `report-404/ExamplePage.html` on the specified instance. For all other HTTP error codes, `error.html` is returned. 

This example also specifies a metrics configuration called `EntireBucket` that enables CloudWatch request metrics at the bucket level.

#### JSON
<a name="aws-resource-s3-bucket--examples--Configure_a_static_website_with_a_routing_rule--json"></a>

```
{
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "AccessControl": "PublicRead",
                "BucketName": "public-bucket",
                "MetricsConfigurations": [
                    {
                        "Id": "EntireBucket"
                    }
                ],
                "WebsiteConfiguration": {
                    "IndexDocument": "index.html",
                    "ErrorDocument": "error.html",
                    "RoutingRules": [
                        {
                            "RoutingRuleCondition": {
                                "HttpErrorCodeReturnedEquals": "404",
                                "KeyPrefixEquals": "out1/"
                            },
                            "RedirectRule": {
                                "HostName": "ec2-11-22-333-44.compute-1.amazonaws.com",
                                "ReplaceKeyPrefixWith": "report-404/"
                            }
                        }
                    ]
                }
            },
            "DeletionPolicy": "Retain"
        }
    },
    "Outputs": {
        "WebsiteURL": {
            "Value": {
                "Fn::GetAtt": [
                    "S3Bucket",
                    "WebsiteURL"
                ]
            },
            "Description": "URL for website hosted on S3"
        },
        "S3BucketSecureURL": {
            "Value": {
                "Fn::Join": [
                    "",
                    [
                        "https://",
                        {
                            "Fn::GetAtt": [
                                "S3Bucket",
                                "DomainName"
                            ]
                        }
                    ]
                ]
            },
            "Description": "Name of S3 bucket to hold website content"
        }
    }
}
```

#### YAML
<a name="aws-resource-s3-bucket--examples--Configure_a_static_website_with_a_routing_rule--yaml"></a>

```
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      AccessControl: PublicRead
      BucketName: public-bucket
      MetricsConfigurations:
        - Id: EntireBucket
      WebsiteConfiguration:
        IndexDocument: index.html
        ErrorDocument: error.html
        RoutingRules:
          - RoutingRuleCondition:
              HttpErrorCodeReturnedEquals: '404'
              KeyPrefixEquals: out1/
            RedirectRule:
              HostName: ec2-11-22-333-44.compute-1.amazonaws.com
              ReplaceKeyPrefixWith: report-404/
    DeletionPolicy: Retain
Outputs:
  WebsiteURL:
    Value: !GetAtt
      - S3Bucket
      - WebsiteURL
    Description: URL for website hosted on S3
  S3BucketSecureURL:
    Value: !Join
      - ''
      - - 'https://'
        - !GetAtt
          - S3Bucket
          - DomainName
    Description: Name of S3 bucket to hold website content
```

### Enable cross-origin resource sharing
<a name="aws-resource-s3-bucket--examples--Enable_cross-origin_resource_sharing"></a>

The following example template shows a public S3 bucket with two cross-origin resource sharing rules.

#### JSON
<a name="aws-resource-s3-bucket--examples--Enable_cross-origin_resource_sharing--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "AccessControl": "PublicRead",
                "CorsConfiguration": {
                    "CorsRules": [
                        {
                            "AllowedHeaders": [
                                "*"
                            ],
                            "AllowedMethods": [
                                "GET"
                            ],
                            "AllowedOrigins": [
                                "*"
                            ],
                            "ExposedHeaders": [
                                "Date"
                            ],
                            "Id": "myCORSRuleId1",
                            "MaxAge": 3600
                        },
                        {
                            "AllowedHeaders": [
                                "x-amz-*"
                            ],
                            "AllowedMethods": [
                                "DELETE"
                            ],
                            "AllowedOrigins": [
                                "http://www.example.com",
                                "http://www.example.net"
                            ],
                            "ExposedHeaders": [
                                "Connection",
                                "Server",
                                "Date"
                            ],
                            "Id": "myCORSRuleId2",
                            "MaxAge": 1800
                        }
                    ]
                }
            }
        }
    },
    "Outputs": {
        "BucketName": {
            "Value": {
                "Ref": "S3Bucket"
            },
            "Description": "Name of the sample Amazon S3 bucket with CORS enabled."
        }
    }
}
```

#### YAML
<a name="aws-resource-s3-bucket--examples--Enable_cross-origin_resource_sharing--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      AccessControl: PublicRead
      CorsConfiguration:
        CorsRules:
          - AllowedHeaders:
              - '*'
            AllowedMethods:
              - GET
            AllowedOrigins:
              - '*'
            ExposedHeaders:
              - Date
            Id: myCORSRuleId1
            MaxAge: 3600
          - AllowedHeaders:
              - x-amz-*
            AllowedMethods:
              - DELETE
            AllowedOrigins:
              - 'http://www.example.com'
              - 'http://www.example.net'
            ExposedHeaders:
              - Connection
              - Server
              - Date
            Id: myCORSRuleId2
            MaxAge: 1800
Outputs:
  BucketName:
    Value: !Ref S3Bucket
    Description: Name of the sample Amazon S3 bucket with CORS enabled.
```

### Manage the lifecycle for S3 objects
<a name="aws-resource-s3-bucket--examples--Manage_the_lifecycle_for_S3_objects"></a>

The following example template shows an S3 bucket with a lifecycle configuration rule. The rule applies to all objects with the `glacier` key prefix. The objects are transitioned to Glacier after one day, and deleted after one year.

#### JSON
<a name="aws-resource-s3-bucket--examples--Manage_the_lifecycle_for_S3_objects--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "AccessControl": "Private",
                "LifecycleConfiguration": {
                    "Rules": [
                        {
                            "Id": "GlacierRule",
                            "Prefix": "glacier",
                            "Status": "Enabled",
                            "ExpirationInDays": 365,
                            "Transitions": [
                                {
                                    "TransitionInDays": 1,
                                    "StorageClass": "GLACIER"
                                }
                            ]
                        }
                    ]
                }
            }
        }
    },
    "Outputs": {
        "BucketName": {
            "Value": {
                "Ref": "S3Bucket"
            },
            "Description": "Name of the sample Amazon S3 bucket with a lifecycle configuration."
        }
    }
}
```

#### YAML
<a name="aws-resource-s3-bucket--examples--Manage_the_lifecycle_for_S3_objects--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      AccessControl: Private
      LifecycleConfiguration:
        Rules:
          - Id: GlacierRule
            Prefix: glacier
            Status: Enabled
            ExpirationInDays: 365
            Transitions:
              - TransitionInDays: 1
                StorageClass: GLACIER
Outputs:
  BucketName:
    Value: !Ref S3Bucket
    Description: Name of the sample Amazon S3 bucket with a lifecycle configuration.
```

### Log access requests for a specific S3 bucket
<a name="aws-resource-s3-bucket--examples--Log_access_requests_for_a_specific_S3_bucket"></a>

The following example template creates two S3 buckets. The `LoggingBucket` bucket store the logs from the `S3Bucket` bucket. To receive logs from the `S3Bucket` bucket, the logging bucket requires log delivery write permissions.

#### JSON
<a name="aws-resource-s3-bucket--examples--Log_access_requests_for_a_specific_S3_bucket--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "LoggingConfiguration": {
                    "DestinationBucketName": {
                        "Ref": "LoggingBucket"
                    },
                    "LogFilePrefix": "testing-logs"
                }
            }
        },
        "LoggingBucket": {
            "Type": "AWS::S3::Bucket"
        },
        "S3BucketPolicy": {
            "Type": "AWS::S3::BucketPolicy",
            "Properties": {
                "Bucket": {
                    "Ref": "LoggingBucket"
                },
                "PolicyDocument": {
                    "Version": "2012-10-17"		 	 	 ,
                    "Statement": [
                        {
                            "Action": [
                                "s3:PutObject"
                            ],
                            "Effect": "Allow",
                            "Principal": {
                                "Service": "logging.s3.amazonaws.com"
                            },
                            "Resource": {
                                "Fn::Join": [
                                    "",
                                    [
                                        "arn:aws:s3:::",
                                        {
                                            "Ref": "LoggingBucket"
                                        },
                                        "/*"
                                    ]
                                ]
                            },
                            "Condition": {
                                "ArnLike": {
                                    "aws:SourceArn": {
                                        "Fn::GetAtt": [
                                            "S3Bucket",
                                            "Arn"
                                        ]
                                    }
                                },
                                "StringEquals": {
                                    "aws:SourceAccount": {
                                        "Fn::Sub": "${AWS::AccountId}"
                                    }
                                }
                            }
                        }
                    ]
                }
            }
        }
    },
    "Outputs": {
        "BucketName": {
            "Value": {
                "Ref": "S3Bucket"
            },
            "Description": "Name of the sample Amazon S3 bucket with a logging configuration."
        }
    }
}
```

#### YAML
<a name="aws-resource-s3-bucket--examples--Log_access_requests_for_a_specific_S3_bucket--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      LoggingConfiguration:
        DestinationBucketName: !Ref LoggingBucket
        LogFilePrefix: testing-logs
  LoggingBucket:
    Type: 'AWS::S3::Bucket'
  S3BucketPolicy:
    Type: 'AWS::S3::BucketPolicy'
    Properties:
      Bucket: !Ref LoggingBucket
      PolicyDocument:
        Version: 2012-10-17
        Statement:
          - Action:
              - 's3:PutObject'
            Effect: Allow
            Principal:
              Service: logging.s3.amazonaws.com
            Resource: !Join 
              - ''
              - - 'arn:aws:s3:::'
                - !Ref LoggingBucket
                - /*
            Condition:
              ArnLike:
                'aws:SourceArn': !GetAtt 
                  - S3Bucket
                  - Arn
              StringEquals:
                'aws:SourceAccount': !Sub '${AWS::AccountId}'
Outputs:
  BucketName:
    Value: !Ref S3Bucket
    Description: Name of the sample Amazon S3 bucket with a logging configuration.
```

### Receive S3 bucket notifications to an SNS topic
<a name="aws-resource-s3-bucket--examples--Receive_S3_bucket_notifications_to_an_SNS_topic"></a>

The following example template shows an Amazon S3 bucket with a notification configuration that sends an event to the specified SNS topic when S3 has lost all replicas of an object.

#### JSON
<a name="aws-resource-s3-bucket--examples--Receive_S3_bucket_notifications_to_an_SNS_topic--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "AccessControl": "Private",
                "NotificationConfiguration": {
                    "TopicConfigurations": [
                        {
                            "Topic": "arn:aws:sns:us-east-1:123456789012:TestTopic",
                            "Event": "s3:ReducedRedundancyLostObject"
                        }
                    ]
                }
            }
        }
    },
    "Outputs": {
        "BucketName": {
            "Value": {
                "Ref": "S3Bucket"
            },
            "Description": "Name of the sample Amazon S3 bucket with a notification configuration."
        }
    }
}
```

#### YAML
<a name="aws-resource-s3-bucket--examples--Receive_S3_bucket_notifications_to_an_SNS_topic--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      AccessControl: Private
      NotificationConfiguration:
        TopicConfigurations:
          - Topic: 'arn:aws:sns:us-east-1:123456789012:TestTopic'
            Event: 's3:ReducedRedundancyLostObject'
Outputs:
  BucketName:
    Value: !Ref S3Bucket
    Description: Name of the sample Amazon S3 bucket with a notification configuration.
```

### Enable versioning and replicate objects
<a name="aws-resource-s3-bucket--examples--Enable_versioning_and_replicate_objects"></a>

The following example enables versioning and two replication rules. The rules copy objects prefixed with either `MyPrefix` and `MyOtherPrefix` and stores the copied objects in a bucket named `my-replication-bucket`.

#### JSON
<a name="aws-resource-s3-bucket--examples--Enable_versioning_and_replicate_objects--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "VersioningConfiguration": {
                    "Status": "Enabled"
                },
                "ReplicationConfiguration": {
                    "Role": "arn:aws:iam::123456789012:role/replication_role",
                    "Rules": [
                        {
                            "Id": "MyRule1",
                            "Status": "Enabled",
                            "Prefix": "MyPrefix",
                            "Destination": {
                                "Bucket": "arn:aws:s3:::my-replication-bucket",
                                "StorageClass": "STANDARD"
                            }
                        },
                        {
                            "Status": "Enabled",
                            "Prefix": "MyOtherPrefix",
                            "Destination": {
                                "Bucket": "arn:aws:s3:::my-replication-bucket"
                            }
                        }
                    ]
                }
            }
        }
    }
}
```

#### YAML
<a name="aws-resource-s3-bucket--examples--Enable_versioning_and_replicate_objects--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      VersioningConfiguration:
        Status: Enabled
      ReplicationConfiguration:
        Role: 'arn:aws:iam::123456789012:role/replication_role'
        Rules:
          - Id: MyRule1
            Status: Enabled
            Prefix: MyPrefix
            Destination:
              Bucket: 'arn:aws:s3:::my-replication-bucket'
              StorageClass: STANDARD
          - Status: Enabled
            Prefix: MyOtherPrefix
            Destination:
              Bucket: 'arn:aws:s3:::my-replication-bucket'
```

### Specify analytics and inventory configurations for an S3 bucket
<a name="aws-resource-s3-bucket--examples--Specify_analytics_and_inventory_configurations_for_an_S3_bucket"></a>

The following example specifies analytics and inventory results to be generated for an S3 bucket, including the format of the results and the destination bucket. The inventory list generates reports weekly and includes the current version of each object.

#### JSON
<a name="aws-resource-s3-bucket--examples--Specify_analytics_and_inventory_configurations_for_an_S3_bucket--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Description": "S3 Bucket with Inventory and Analytics Configurations",
    "Resources": {
        "Helper": {
            "Type": "AWS::S3::Bucket"
        },
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "AnalyticsConfigurations": [
                    {
                        "Id": "AnalyticsConfigurationId",
                        "StorageClassAnalysis": {
                            "DataExport": {
                                "Destination": {
                                    "BucketArn": {
                                        "Fn::GetAtt": [
                                            "Helper",
                                            "Arn"
                                        ]
                                    },
                                    "Format": "CSV",
                                    "Prefix": "AnalyticsDestinationPrefix"
                                },
                                "OutputSchemaVersion": "V_1"
                            }
                        },
                        "Prefix": "AnalyticsConfigurationPrefix",
                        "TagFilters": [
                            {
                                "Key": "AnalyticsTagKey",
                                "Value": "AnalyticsTagValue"
                            }
                        ]
                    }
                ],
                "InventoryConfigurations": [
                    {
                        "Id": "InventoryConfigurationId",
                        "Destination": {
                            "BucketArn": {
                                "Fn::GetAtt": [
                                    "Helper",
                                    "Arn"
                                ]
                            },
                            "Format": "CSV",
                            "Prefix": "InventoryDestinationPrefix"
                        },
                        "Enabled": true,
                        "IncludedObjectVersions": "Current",
                        "Prefix": "InventoryConfigurationPrefix",
                        "ScheduleFrequency": "Weekly"
                    }
                ]
            }
        }
    }
}
```

#### YAML
<a name="aws-resource-s3-bucket--examples--Specify_analytics_and_inventory_configurations_for_an_S3_bucket--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Description: S3 Bucket with Inventory and Analytics Configurations
Resources:
  Helper:
    Type: 'AWS::S3::Bucket'
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      AnalyticsConfigurations:
        - Id: AnalyticsConfigurationId
          StorageClassAnalysis:
            DataExport:
              Destination:
                BucketArn: !GetAtt
                  - Helper
                  - Arn
                Format: CSV
                Prefix: AnalyticsDestinationPrefix
              OutputSchemaVersion: V_1
          Prefix: AnalyticsConfigurationPrefix
          TagFilters:
            - Key: AnalyticsTagKey
              Value: AnalyticsTagValue
      InventoryConfigurations:
        - Id: InventoryConfigurationId
          Destination:
            BucketArn: !GetAtt
              - Helper
              - Arn
            Format: CSV
            Prefix: InventoryDestinationPrefix
          Enabled: true
          IncludedObjectVersions: Current
          Prefix: InventoryConfigurationPrefix
          ScheduleFrequency: Weekly
```

## See also
<a name="aws-resource-s3-bucket--seealso"></a>
+  [Amazon S3 Template Snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-s3.html) 



# AWS::S3::Bucket AbortIncompleteMultipartUpload
<a name="aws-properties-s3-bucket-abortincompletemultipartupload"></a>

Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. For more information, see [ Stopping Incomplete Multipart Uploads Using a Bucket Lifecycle Policy](https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) in the *Amazon S3 User Guide*.

## Syntax
<a name="aws-properties-s3-bucket-abortincompletemultipartupload-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-abortincompletemultipartupload-syntax.json"></a>

```
{
  "[DaysAfterInitiation](#cfn-s3-bucket-abortincompletemultipartupload-daysafterinitiation)" : Integer
}
```

### YAML
<a name="aws-properties-s3-bucket-abortincompletemultipartupload-syntax.yaml"></a>

```
  [DaysAfterInitiation](#cfn-s3-bucket-abortincompletemultipartupload-daysafterinitiation): Integer
```

## Properties
<a name="aws-properties-s3-bucket-abortincompletemultipartupload-properties"></a>

`DaysAfterInitiation`  <a name="cfn-s3-bucket-abortincompletemultipartupload-daysafterinitiation"></a>
Specifies the number of days after which Amazon S3 stops an incomplete multipart upload.  
*Required*: Yes  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket AccelerateConfiguration
<a name="aws-properties-s3-bucket-accelerateconfiguration"></a>

Configures the transfer acceleration state for an Amazon S3 bucket. For more information, see [Amazon S3 Transfer Acceleration](https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html) in the *Amazon S3 User Guide*.

## Syntax
<a name="aws-properties-s3-bucket-accelerateconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-accelerateconfiguration-syntax.json"></a>

```
{
  "[AccelerationStatus](#cfn-s3-bucket-accelerateconfiguration-accelerationstatus)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-accelerateconfiguration-syntax.yaml"></a>

```
  [AccelerationStatus](#cfn-s3-bucket-accelerateconfiguration-accelerationstatus): String
```

## Properties
<a name="aws-properties-s3-bucket-accelerateconfiguration-properties"></a>

`AccelerationStatus`  <a name="cfn-s3-bucket-accelerateconfiguration-accelerationstatus"></a>
Specifies the transfer acceleration status of the bucket.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `Enabled | Suspended`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## See also
<a name="aws-properties-s3-bucket-accelerateconfiguration--seealso"></a>
+ AWS::S3::Bucket [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#aws-properties-s3-bucket--examples)



# AWS::S3::Bucket AccessControlTranslation
<a name="aws-properties-s3-bucket-accesscontroltranslation"></a>

Specify this only in a cross-account scenario (where source and destination bucket owners are not the same), and you want to change replica ownership to the AWS account that owns the destination bucket. If this is not specified in the replication configuration, the replicas are owned by same AWS account that owns the source object.

## Syntax
<a name="aws-properties-s3-bucket-accesscontroltranslation-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-accesscontroltranslation-syntax.json"></a>

```
{
  "[Owner](#cfn-s3-bucket-accesscontroltranslation-owner)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-accesscontroltranslation-syntax.yaml"></a>

```
  [Owner](#cfn-s3-bucket-accesscontroltranslation-owner): String
```

## Properties
<a name="aws-properties-s3-bucket-accesscontroltranslation-properties"></a>

`Owner`  <a name="cfn-s3-bucket-accesscontroltranslation-owner"></a>
Specifies the replica ownership. For default and valid values, see [PUT bucket replication](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html) in the *Amazon S3 API Reference*.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `Destination`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket AnalyticsConfiguration
<a name="aws-properties-s3-bucket-analyticsconfiguration"></a>

Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket.

## Syntax
<a name="aws-properties-s3-bucket-analyticsconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-analyticsconfiguration-syntax.json"></a>

```
{
  "[Id](#cfn-s3-bucket-analyticsconfiguration-id)" : String,
  "[Prefix](#cfn-s3-bucket-analyticsconfiguration-prefix)" : String,
  "[StorageClassAnalysis](#cfn-s3-bucket-analyticsconfiguration-storageclassanalysis)" : StorageClassAnalysis,
  "[TagFilters](#cfn-s3-bucket-analyticsconfiguration-tagfilters)" : [ TagFilter, ... ]
}
```

### YAML
<a name="aws-properties-s3-bucket-analyticsconfiguration-syntax.yaml"></a>

```
  [Id](#cfn-s3-bucket-analyticsconfiguration-id): String
  [Prefix](#cfn-s3-bucket-analyticsconfiguration-prefix): String
  [StorageClassAnalysis](#cfn-s3-bucket-analyticsconfiguration-storageclassanalysis): 
    StorageClassAnalysis
  [TagFilters](#cfn-s3-bucket-analyticsconfiguration-tagfilters): 
    - TagFilter
```

## Properties
<a name="aws-properties-s3-bucket-analyticsconfiguration-properties"></a>

`Id`  <a name="cfn-s3-bucket-analyticsconfiguration-id"></a>
The ID that identifies the analytics configuration.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Prefix`  <a name="cfn-s3-bucket-analyticsconfiguration-prefix"></a>
The prefix that an object must have to be included in the analytics results.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`StorageClassAnalysis`  <a name="cfn-s3-bucket-analyticsconfiguration-storageclassanalysis"></a>
 Contains data related to access patterns to be collected and made available to analyze the tradeoffs between different storage classes.   
*Required*: Yes  
*Type*: [StorageClassAnalysis](aws-properties-s3-bucket-storageclassanalysis.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TagFilters`  <a name="cfn-s3-bucket-analyticsconfiguration-tagfilters"></a>
The tags to use when evaluating an analytics filter.  
The analytics only includes objects that meet the filter's criteria. If no filter is specified, all of the contents of the bucket are included in the analysis.  
*Required*: No  
*Type*: Array of [TagFilter](aws-properties-s3-bucket-tagfilter.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-analyticsconfiguration--examples"></a>



### Specify analytics and inventory configurations for an S3 bucket
<a name="aws-properties-s3-bucket-analyticsconfiguration--examples--Specify_analytics_and_inventory_configurations_for_an_S3_bucket"></a>

The following example specifies analytics and inventory results to be generated for an S3 bucket, including the format of the results and the destination bucket. The inventory list generates reports weekly and includes the current version of each object.

#### JSON
<a name="aws-properties-s3-bucket-analyticsconfiguration--examples--Specify_analytics_and_inventory_configurations_for_an_S3_bucket--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Description": "S3 Bucket with Inventory and Analytics Configurations",
    "Resources": {
        "Helper": {
            "Type": "AWS::S3::Bucket"
        },
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "AnalyticsConfigurations": [
                    {
                        "Id": "AnalyticsConfigurationId",
                        "StorageClassAnalysis": {
                            "DataExport": {
                                "Destination": {
                                    "BucketArn": {
                                        "Fn::GetAtt": [
                                            "Helper",
                                            "Arn"
                                        ]
                                    },
                                    "Format": "CSV",
                                    "Prefix": "AnalyticsDestinationPrefix"
                                },
                                "OutputSchemaVersion": "V_1"
                            }
                        },
                        "Prefix": "AnalyticsConfigurationPrefix",
                        "TagFilters": [
                            {
                                "Key": "AnalyticsTagKey",
                                "Value": "AnalyticsTagValue"
                            }
                        ]
                    }
                ],
                "InventoryConfigurations": [
                    {
                        "Id": "InventoryConfigurationId",
                        "Destination": {
                            "BucketArn": {
                                "Fn::GetAtt": [
                                    "Helper",
                                    "Arn"
                                ]
                            },
                            "Format": "CSV",
                            "Prefix": "InventoryDestinationPrefix"
                        },
                        "Enabled": true,
                        "IncludedObjectVersions": "Current",
                        "Prefix": "InventoryConfigurationPrefix",
                        "ScheduleFrequency": "Weekly"
                    }
                ]
            }
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-analyticsconfiguration--examples--Specify_analytics_and_inventory_configurations_for_an_S3_bucket--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Description: S3 Bucket with Inventory and Analytics Configurations
Resources:
  Helper:
    Type: 'AWS::S3::Bucket'
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      AnalyticsConfigurations:
        - Id: AnalyticsConfigurationId
          StorageClassAnalysis:
            DataExport:
              Destination:
                BucketArn: !GetAtt
                  - Helper
                  - Arn
                Format: CSV
                Prefix: AnalyticsDestinationPrefix
              OutputSchemaVersion: V_1
          Prefix: AnalyticsConfigurationPrefix
          TagFilters:
            - Key: AnalyticsTagKey
              Value: AnalyticsTagValue
      InventoryConfigurations:
        - Id: InventoryConfigurationId
          Destination:
            BucketArn: !GetAtt
              - Helper
              - Arn
            Format: CSV
            Prefix: InventoryDestinationPrefix
          Enabled: true
          IncludedObjectVersions: Current
          Prefix: InventoryConfigurationPrefix
          ScheduleFrequency: Weekly
```

# AWS::S3::Bucket BlockedEncryptionTypes
<a name="aws-properties-s3-bucket-blockedencryptiontypes"></a>

A bucket-level setting for Amazon S3 general purpose buckets used to prevent the upload of new objects encrypted with the specified server-side encryption type. For example, blocking an encryption type will block `PutObject`, `CopyObject`, `PostObject`, multipart upload, and replication requests to the bucket for objects with the specified encryption type. However, you can continue to read and list any pre-existing objects already encrypted with the specified encryption type. For more information, see [Blocking or unblocking SSE-C for a general purpose bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/blocking-unblocking-s3-c-encryption-gpb.html).

This data type is used with the following actions:
+  [PutBucketEncryption](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html) 
+  [GetBucketEncryption](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html) 
+  [DeleteBucketEncryption](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html) 

Permissions  
You must have the `s3:PutEncryptionConfiguration` permission to block or unblock an encryption type for a bucket.   
You must have the `s3:GetEncryptionConfiguration` permission to view a bucket's encryption type. 

## Syntax
<a name="aws-properties-s3-bucket-blockedencryptiontypes-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-blockedencryptiontypes-syntax.json"></a>

```
{
  "[EncryptionType](#cfn-s3-bucket-blockedencryptiontypes-encryptiontype)" : [ String, ... ]
}
```

### YAML
<a name="aws-properties-s3-bucket-blockedencryptiontypes-syntax.yaml"></a>

```
  [EncryptionType](#cfn-s3-bucket-blockedencryptiontypes-encryptiontype): 
    - String
```

## Properties
<a name="aws-properties-s3-bucket-blockedencryptiontypes-properties"></a>

`EncryptionType`  <a name="cfn-s3-bucket-blockedencryptiontypes-encryptiontype"></a>
The object encryption type that you want to block or unblock for an Amazon S3 general purpose bucket.  
Currently, this parameter only supports blocking or unblocking server side encryption with customer-provided keys (SSE-C). For more information about SSE-C, see [Using server-side encryption with customer-provided keys (SSE-C)](https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html).
*Required*: No  
*Type*: Array of String  
*Allowed values*: `NONE | SSE-C`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket BucketEncryption
<a name="aws-properties-s3-bucket-bucketencryption"></a>

Specifies default encryption for a bucket using server-side encryption with Amazon S3-managed keys (SSE-S3), AWS KMS-managed keys (SSE-KMS), or dual-layer server-side encryption with KMS-managed keys (DSSE-KMS). For information about the Amazon S3 default encryption feature, see [Amazon S3 Default Encryption for S3 Buckets](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) in the *Amazon S3 User Guide*.

## Syntax
<a name="aws-properties-s3-bucket-bucketencryption-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-bucketencryption-syntax.json"></a>

```
{
  "[ServerSideEncryptionConfiguration](#cfn-s3-bucket-bucketencryption-serversideencryptionconfiguration)" : [ ServerSideEncryptionRule, ... ]
}
```

### YAML
<a name="aws-properties-s3-bucket-bucketencryption-syntax.yaml"></a>

```
  [ServerSideEncryptionConfiguration](#cfn-s3-bucket-bucketencryption-serversideencryptionconfiguration): 
    - ServerSideEncryptionRule
```

## Properties
<a name="aws-properties-s3-bucket-bucketencryption-properties"></a>

`ServerSideEncryptionConfiguration`  <a name="cfn-s3-bucket-bucketencryption-serversideencryptionconfiguration"></a>
Specifies the default server-side-encryption configuration.  
*Required*: Yes  
*Type*: Array of [ServerSideEncryptionRule](aws-properties-s3-bucket-serversideencryptionrule.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## See also
<a name="aws-properties-s3-bucket-bucketencryption--seealso"></a>
+ AWS::S3::Bucket [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#aws-properties-s3-bucket--examples)



# AWS::S3::Bucket CorsConfiguration
<a name="aws-properties-s3-bucket-corsconfiguration"></a>

Describes the cross-origin access configuration for objects in an Amazon S3 bucket. For more information, see [Enabling Cross-Origin Resource Sharing](https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the *Amazon S3 User Guide*.

## Syntax
<a name="aws-properties-s3-bucket-corsconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-corsconfiguration-syntax.json"></a>

```
{
  "[CorsRules](#cfn-s3-bucket-corsconfiguration-corsrules)" : [ CorsRule, ... ]
}
```

### YAML
<a name="aws-properties-s3-bucket-corsconfiguration-syntax.yaml"></a>

```
  [CorsRules](#cfn-s3-bucket-corsconfiguration-corsrules): 
    - CorsRule
```

## Properties
<a name="aws-properties-s3-bucket-corsconfiguration-properties"></a>

`CorsRules`  <a name="cfn-s3-bucket-corsconfiguration-corsrules"></a>
A set of origins and methods (cross-origin access that you want to allow). You can add up to 100 rules to the configuration.  
*Required*: Yes  
*Type*: Array of [CorsRule](aws-properties-s3-bucket-corsrule.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-corsconfiguration--examples"></a>



### Enable cross-origin resource sharing
<a name="aws-properties-s3-bucket-corsconfiguration--examples--Enable_cross-origin_resource_sharing"></a>

The following example template shows a public S3 bucket with two cross-origin resource sharing rules.

#### JSON
<a name="aws-properties-s3-bucket-corsconfiguration--examples--Enable_cross-origin_resource_sharing--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "AccessControl": "PublicRead",
                "CorsConfiguration": {
                    "CorsRules": [
                        {
                            "AllowedHeaders": [
                                "*"
                            ],
                            "AllowedMethods": [
                                "GET"
                            ],
                            "AllowedOrigins": [
                                "*"
                            ],
                            "ExposedHeaders": [
                                "Date"
                            ],
                            "Id": "myCORSRuleId1",
                            "MaxAge": 3600
                        },
                        {
                            "AllowedHeaders": [
                                "x-amz-*"
                            ],
                            "AllowedMethods": [
                                "DELETE"
                            ],
                            "AllowedOrigins": [
                                "http://www.example.com",
                                "http://www.example.net"
                            ],
                            "ExposedHeaders": [
                                "Connection",
                                "Server",
                                "Date"
                            ],
                            "Id": "myCORSRuleId2",
                            "MaxAge": 1800
                        }
                    ]
                }
            }
        }
    },
    "Outputs": {
        "BucketName": {
            "Value": {
                "Ref": "S3Bucket"
            },
            "Description": "Name of the sample Amazon S3 bucket with CORS enabled."
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-corsconfiguration--examples--Enable_cross-origin_resource_sharing--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      AccessControl: PublicRead
      CorsConfiguration:
        CorsRules:
          - AllowedHeaders:
              - '*'
            AllowedMethods:
              - GET
            AllowedOrigins:
              - '*'
            ExposedHeaders:
              - Date
            Id: myCORSRuleId1
            MaxAge: 3600
          - AllowedHeaders:
              - x-amz-*
            AllowedMethods:
              - DELETE
            AllowedOrigins:
              - 'http://www.example.com'
              - 'http://www.example.net'
            ExposedHeaders:
              - Connection
              - Server
              - Date
            Id: myCORSRuleId2
            MaxAge: 1800
Outputs:
  BucketName:
    Value: !Ref S3Bucket
    Description: Name of the sample Amazon S3 bucket with CORS enabled.
```

# AWS::S3::Bucket CorsRule
<a name="aws-properties-s3-bucket-corsrule"></a>

Specifies a cross-origin access rule for an Amazon S3 bucket.

## Syntax
<a name="aws-properties-s3-bucket-corsrule-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-corsrule-syntax.json"></a>

```
{
  "[AllowedHeaders](#cfn-s3-bucket-corsrule-allowedheaders)" : [ String, ... ],
  "[AllowedMethods](#cfn-s3-bucket-corsrule-allowedmethods)" : [ String, ... ],
  "[AllowedOrigins](#cfn-s3-bucket-corsrule-allowedorigins)" : [ String, ... ],
  "[ExposedHeaders](#cfn-s3-bucket-corsrule-exposedheaders)" : [ String, ... ],
  "[Id](#cfn-s3-bucket-corsrule-id)" : String,
  "[MaxAge](#cfn-s3-bucket-corsrule-maxage)" : Integer
}
```

### YAML
<a name="aws-properties-s3-bucket-corsrule-syntax.yaml"></a>

```
  [AllowedHeaders](#cfn-s3-bucket-corsrule-allowedheaders): 
    - String
  [AllowedMethods](#cfn-s3-bucket-corsrule-allowedmethods): 
    - String
  [AllowedOrigins](#cfn-s3-bucket-corsrule-allowedorigins): 
    - String
  [ExposedHeaders](#cfn-s3-bucket-corsrule-exposedheaders): 
    - String
  [Id](#cfn-s3-bucket-corsrule-id): String
  [MaxAge](#cfn-s3-bucket-corsrule-maxage): Integer
```

## Properties
<a name="aws-properties-s3-bucket-corsrule-properties"></a>

`AllowedHeaders`  <a name="cfn-s3-bucket-corsrule-allowedheaders"></a>
Headers that are specified in the `Access-Control-Request-Headers` header. These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed.  
*Required*: No  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AllowedMethods`  <a name="cfn-s3-bucket-corsrule-allowedmethods"></a>
An HTTP method that you allow the origin to run.  
*Allowed values*: `GET` \$1 `PUT` \$1 `HEAD` \$1 `POST` \$1 `DELETE`  
*Required*: Yes  
*Type*: Array of String  
*Allowed values*: `GET | PUT | HEAD | POST | DELETE`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AllowedOrigins`  <a name="cfn-s3-bucket-corsrule-allowedorigins"></a>
One or more origins you want customers to be able to access the bucket from.  
*Required*: Yes  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ExposedHeaders`  <a name="cfn-s3-bucket-corsrule-exposedheaders"></a>
One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript `XMLHttpRequest` object).  
*Required*: No  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Id`  <a name="cfn-s3-bucket-corsrule-id"></a>
A unique identifier for this rule. The value must be no more than 255 characters.  
*Required*: No  
*Type*: String  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MaxAge`  <a name="cfn-s3-bucket-corsrule-maxage"></a>
The time in seconds that your browser is to cache the preflight response for the specified resource.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-corsrule--examples"></a>



### Enable cross-origin resource sharing
<a name="aws-properties-s3-bucket-corsrule--examples--Enable_cross-origin_resource_sharing"></a>

The following example template shows a public S3 bucket with two cross-origin resource sharing rules.

#### JSON
<a name="aws-properties-s3-bucket-corsrule--examples--Enable_cross-origin_resource_sharing--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "AccessControl": "PublicRead",
                "CorsConfiguration": {
                    "CorsRules": [
                        {
                            "AllowedHeaders": [
                                "*"
                            ],
                            "AllowedMethods": [
                                "GET"
                            ],
                            "AllowedOrigins": [
                                "*"
                            ],
                            "ExposedHeaders": [
                                "Date"
                            ],
                            "Id": "myCORSRuleId1",
                            "MaxAge": 3600
                        },
                        {
                            "AllowedHeaders": [
                                "x-amz-*"
                            ],
                            "AllowedMethods": [
                                "DELETE"
                            ],
                            "AllowedOrigins": [
                                "http://www.example.com",
                                "http://www.example.net"
                            ],
                            "ExposedHeaders": [
                                "Connection",
                                "Server",
                                "Date"
                            ],
                            "Id": "myCORSRuleId2",
                            "MaxAge": 1800
                        }
                    ]
                }
            }
        }
    },
    "Outputs": {
        "BucketName": {
            "Value": {
                "Ref": "S3Bucket"
            },
            "Description": "Name of the sample Amazon S3 bucket with CORS enabled."
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-corsrule--examples--Enable_cross-origin_resource_sharing--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      AccessControl: PublicRead
      CorsConfiguration:
        CorsRules:
          - AllowedHeaders:
              - '*'
            AllowedMethods:
              - GET
            AllowedOrigins:
              - '*'
            ExposedHeaders:
              - Date
            Id: myCORSRuleId1
            MaxAge: 3600
          - AllowedHeaders:
              - x-amz-*
            AllowedMethods:
              - DELETE
            AllowedOrigins:
              - 'http://www.example.com'
              - 'http://www.example.net'
            ExposedHeaders:
              - Connection
              - Server
              - Date
            Id: myCORSRuleId2
            MaxAge: 1800
Outputs:
  BucketName:
    Value: !Ref S3Bucket
    Description: Name of the sample Amazon S3 bucket with CORS enabled.
```

# AWS::S3::Bucket DataExport
<a name="aws-properties-s3-bucket-dataexport"></a>

Specifies how data related to the storage class analysis for an Amazon S3 bucket should be exported.

## Syntax
<a name="aws-properties-s3-bucket-dataexport-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-dataexport-syntax.json"></a>

```
{
  "[Destination](#cfn-s3-bucket-dataexport-destination)" : Destination,
  "[OutputSchemaVersion](#cfn-s3-bucket-dataexport-outputschemaversion)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-dataexport-syntax.yaml"></a>

```
  [Destination](#cfn-s3-bucket-dataexport-destination): 
    Destination
  [OutputSchemaVersion](#cfn-s3-bucket-dataexport-outputschemaversion): String
```

## Properties
<a name="aws-properties-s3-bucket-dataexport-properties"></a>

`Destination`  <a name="cfn-s3-bucket-dataexport-destination"></a>
The place to store the data for an analysis.  
*Required*: Yes  
*Type*: [Destination](aws-properties-s3-bucket-destination.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`OutputSchemaVersion`  <a name="cfn-s3-bucket-dataexport-outputschemaversion"></a>
The version of the output schema to use when exporting data. Must be `V_1`.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `V_1`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## See also
<a name="aws-properties-s3-bucket-dataexport--seealso"></a>
+ AWS::S3::Bucket [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#aws-properties-s3-bucket--examples)



# AWS::S3::Bucket DefaultRetention
<a name="aws-properties-s3-bucket-defaultretention"></a>

The container element for optionally specifying the default Object Lock retention settings for new objects placed in the specified bucket.

**Note**  
The `DefaultRetention` settings require both a mode and a period.
The `DefaultRetention` period can be either `Days` or `Years` but you must select one. You cannot specify `Days` and `Years` at the same time.

## Syntax
<a name="aws-properties-s3-bucket-defaultretention-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-defaultretention-syntax.json"></a>

```
{
  "[Days](#cfn-s3-bucket-defaultretention-days)" : Integer,
  "[Mode](#cfn-s3-bucket-defaultretention-mode)" : String,
  "[Years](#cfn-s3-bucket-defaultretention-years)" : Integer
}
```

### YAML
<a name="aws-properties-s3-bucket-defaultretention-syntax.yaml"></a>

```
  [Days](#cfn-s3-bucket-defaultretention-days): Integer
  [Mode](#cfn-s3-bucket-defaultretention-mode): String
  [Years](#cfn-s3-bucket-defaultretention-years): Integer
```

## Properties
<a name="aws-properties-s3-bucket-defaultretention-properties"></a>

`Days`  <a name="cfn-s3-bucket-defaultretention-days"></a>
The number of days that you want to specify for the default retention period. If Object Lock is turned on, you must specify `Mode` and specify either `Days` or `Years`.  
*Required*: Conditional  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Mode`  <a name="cfn-s3-bucket-defaultretention-mode"></a>
The default Object Lock retention mode you want to apply to new objects placed in the specified bucket. If Object Lock is turned on, you must specify `Mode` and specify either `Days` or `Years`.  
*Required*: Conditional  
*Type*: String  
*Allowed values*: `COMPLIANCE | GOVERNANCE`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Years`  <a name="cfn-s3-bucket-defaultretention-years"></a>
The number of years that you want to specify for the default retention period. If Object Lock is turned on, you must specify `Mode` and specify either `Days` or `Years`.  
*Required*: Conditional  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## See also
<a name="aws-properties-s3-bucket-defaultretention--seealso"></a>
+ AWS::S3::Bucket [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#aws-properties-s3-bucket--examples)



# AWS::S3::Bucket DeleteMarkerReplication
<a name="aws-properties-s3-bucket-deletemarkerreplication"></a>

Specifies whether Amazon S3 replicates delete markers. If you specify a `Filter` in your replication configuration, you must also include a `DeleteMarkerReplication` element. If your `Filter` includes a `Tag` element, the `DeleteMarkerReplication``Status` must be set to Disabled, because Amazon S3 does not support replicating delete markers for tag-based rules. For an example configuration, see [Basic Rule Configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-config-min-rule-config). 

For more information about delete marker replication, see [Basic Rule Configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html). 

**Note**  
If you are using an earlier version of the replication configuration, Amazon S3 handles replication of delete markers differently. For more information, see [Backward Compatibility](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations).

## Syntax
<a name="aws-properties-s3-bucket-deletemarkerreplication-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-deletemarkerreplication-syntax.json"></a>

```
{
  "[Status](#cfn-s3-bucket-deletemarkerreplication-status)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-deletemarkerreplication-syntax.yaml"></a>

```
  [Status](#cfn-s3-bucket-deletemarkerreplication-status): String
```

## Properties
<a name="aws-properties-s3-bucket-deletemarkerreplication-properties"></a>

`Status`  <a name="cfn-s3-bucket-deletemarkerreplication-status"></a>
Indicates whether to replicate delete markers.  
*Required*: No  
*Type*: String  
*Allowed values*: `Disabled | Enabled`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket Destination
<a name="aws-properties-s3-bucket-destination"></a>

Specifies information about where to publish analysis or configuration results for an Amazon S3 bucket.

## Syntax
<a name="aws-properties-s3-bucket-destination-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-destination-syntax.json"></a>

```
{
  "[BucketAccountId](#cfn-s3-bucket-destination-bucketaccountid)" : String,
  "[BucketArn](#cfn-s3-bucket-destination-bucketarn)" : String,
  "[Format](#cfn-s3-bucket-destination-format)" : String,
  "[Prefix](#cfn-s3-bucket-destination-prefix)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-destination-syntax.yaml"></a>

```
  [BucketAccountId](#cfn-s3-bucket-destination-bucketaccountid): String
  [BucketArn](#cfn-s3-bucket-destination-bucketarn): String
  [Format](#cfn-s3-bucket-destination-format): String
  [Prefix](#cfn-s3-bucket-destination-prefix): String
```

## Properties
<a name="aws-properties-s3-bucket-destination-properties"></a>

`BucketAccountId`  <a name="cfn-s3-bucket-destination-bucketaccountid"></a>
The account ID that owns the destination S3 bucket. If no account ID is provided, the owner is not validated before exporting data.  
 Although this value is optional, we strongly recommend that you set it to help prevent problems if the destination bucket ownership changes. 
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`BucketArn`  <a name="cfn-s3-bucket-destination-bucketarn"></a>
The Amazon Resource Name (ARN) of the bucket to which data is exported.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Format`  <a name="cfn-s3-bucket-destination-format"></a>
Specifies the file format used when exporting data to Amazon S3.  
*Allowed values*: `CSV` \$1 `ORC` \$1 `Parquet`  
*Required*: Yes  
*Type*: String  
*Allowed values*: `CSV | ORC | Parquet`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Prefix`  <a name="cfn-s3-bucket-destination-prefix"></a>
The prefix to use when exporting data. The prefix is prepended to all results.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## See also
<a name="aws-properties-s3-bucket-destination--seealso"></a>
+ AWS::S3::Bucket [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#aws-properties-s3-bucket--examples)



# AWS::S3::Bucket EncryptionConfiguration
<a name="aws-properties-s3-bucket-encryptionconfiguration"></a>

Specifies encryption-related information for an Amazon S3 bucket that is a destination for replicated objects.

**Note**  
If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then AWS KMS resolves the key within the requester’s account. This behavior can result in data that's encrypted with a KMS key that belongs to the requester, and not the bucket owner.

## Syntax
<a name="aws-properties-s3-bucket-encryptionconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-encryptionconfiguration-syntax.json"></a>

```
{
  "[ReplicaKmsKeyID](#cfn-s3-bucket-encryptionconfiguration-replicakmskeyid)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-encryptionconfiguration-syntax.yaml"></a>

```
  [ReplicaKmsKeyID](#cfn-s3-bucket-encryptionconfiguration-replicakmskeyid): String
```

## Properties
<a name="aws-properties-s3-bucket-encryptionconfiguration-properties"></a>

`ReplicaKmsKeyID`  <a name="cfn-s3-bucket-encryptionconfiguration-replicakmskeyid"></a>
Specifies the ID (Key ARN or Alias ARN) of the customer managed AWS KMS key stored in AWS Key Management Service (KMS) for the destination bucket. Amazon S3 uses this key to encrypt replica objects. Amazon S3 only supports symmetric encryption KMS keys. For more information, see [Asymmetric keys in AWS KMS](https://docs.aws.amazon.com//kms/latest/developerguide/symmetric-asymmetric.html) in the *AWS Key Management Service Developer Guide*.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## See also
<a name="aws-properties-s3-bucket-encryptionconfiguration--seealso"></a>
+ AWS::S3::Bucket [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#aws-properties-s3-bucket--examples)



# AWS::S3::Bucket EventBridgeConfiguration
<a name="aws-properties-s3-bucket-eventbridgeconfiguration"></a>

Amazon S3 can send events to Amazon EventBridge whenever certain events happen in your bucket, see [Using EventBridge](https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventBridge.html) in the *Amazon S3 User Guide*.

Unlike other destinations, delivery of events to EventBridge can be either enabled or disabled for a bucket. If enabled, all events will be sent to EventBridge and you can use EventBridge rules to route events to additional targets. For more information, see [What Is Amazon EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html) in the *Amazon EventBridge User Guide*

## Syntax
<a name="aws-properties-s3-bucket-eventbridgeconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-eventbridgeconfiguration-syntax.json"></a>

```
{
  "[EventBridgeEnabled](#cfn-s3-bucket-eventbridgeconfiguration-eventbridgeenabled)" : Boolean
}
```

### YAML
<a name="aws-properties-s3-bucket-eventbridgeconfiguration-syntax.yaml"></a>

```
  [EventBridgeEnabled](#cfn-s3-bucket-eventbridgeconfiguration-eventbridgeenabled): Boolean
```

## Properties
<a name="aws-properties-s3-bucket-eventbridgeconfiguration-properties"></a>

`EventBridgeEnabled`  <a name="cfn-s3-bucket-eventbridgeconfiguration-eventbridgeenabled"></a>
Enables delivery of events to Amazon EventBridge.  
*Required*: Yes  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-eventbridgeconfiguration--examples"></a>



### Enable EventBridgeConfiguration
<a name="aws-properties-s3-bucket-eventbridgeconfiguration--examples--Enable_EventBridgeConfiguration"></a>

The following example template shows an Amazon S3 bucket with a notification configuration with EventBridge enabled.

#### JSON
<a name="aws-properties-s3-bucket-eventbridgeconfiguration--examples--Enable_EventBridgeConfiguration--json"></a>

```
{
"Resources": {
  "S3Bucket": {
    "Type": "AWS::S3::Bucket",
    "Properties": {
      "NotificationConfiguration": {
        "EventBridgeConfiguration": {
          "EventBridgeEnabled": true
          }
        }
      }
    }
  }
}
```

#### YAML
<a name="aws-properties-s3-bucket-eventbridgeconfiguration--examples--Enable_EventBridgeConfiguration--yaml"></a>

```
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      NotificationConfiguration:
        EventBridgeConfiguration:
          EventBridgeEnabled: true
```

# AWS::S3::Bucket FilterRule
<a name="aws-properties-s3-bucket-filterrule"></a>

Specifies the Amazon S3 object key name to filter on. An object key name is the name assigned to an object in your Amazon S3 bucket. You specify whether to filter on the suffix or prefix of the object key name. A prefix is a specific string of characters at the beginning of an object key name, which you can use to organize objects. For example, you can start the key names of related objects with a prefix, such as `2023-` or `engineering/`. Then, you can use `FilterRule` to find objects in a bucket with key names that have the same prefix. A suffix is similar to a prefix, but it is at the end of the object key name instead of at the beginning.

## Syntax
<a name="aws-properties-s3-bucket-filterrule-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-filterrule-syntax.json"></a>

```
{
  "[Name](#cfn-s3-bucket-filterrule-name)" : String,
  "[Value](#cfn-s3-bucket-filterrule-value)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-filterrule-syntax.yaml"></a>

```
  [Name](#cfn-s3-bucket-filterrule-name): String
  [Value](#cfn-s3-bucket-filterrule-value): String
```

## Properties
<a name="aws-properties-s3-bucket-filterrule-properties"></a>

`Name`  <a name="cfn-s3-bucket-filterrule-name"></a>
The object key name prefix or suffix identifying one or more objects to which the filtering rule applies. The maximum length is 1,024 characters. Overlapping prefixes and suffixes are not supported. For more information, see [Configuring Event Notifications](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) in the *Amazon S3 User Guide*.  
*Required*: Yes  
*Type*: String  
*Maximum*: `1024`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-s3-bucket-filterrule-value"></a>
The value that the filter searches for in object key names.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket IntelligentTieringConfiguration
<a name="aws-properties-s3-bucket-intelligenttieringconfiguration"></a>

Specifies the S3 Intelligent-Tiering configuration for an Amazon S3 bucket.

For information about the S3 Intelligent-Tiering storage class, see [Storage class for automatically optimizing frequently and infrequently accessed objects](https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access).

## Syntax
<a name="aws-properties-s3-bucket-intelligenttieringconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-intelligenttieringconfiguration-syntax.json"></a>

```
{
  "[Id](#cfn-s3-bucket-intelligenttieringconfiguration-id)" : String,
  "[Prefix](#cfn-s3-bucket-intelligenttieringconfiguration-prefix)" : String,
  "[Status](#cfn-s3-bucket-intelligenttieringconfiguration-status)" : String,
  "[TagFilters](#cfn-s3-bucket-intelligenttieringconfiguration-tagfilters)" : [ TagFilter, ... ],
  "[Tierings](#cfn-s3-bucket-intelligenttieringconfiguration-tierings)" : [ Tiering, ... ]
}
```

### YAML
<a name="aws-properties-s3-bucket-intelligenttieringconfiguration-syntax.yaml"></a>

```
  [Id](#cfn-s3-bucket-intelligenttieringconfiguration-id): String
  [Prefix](#cfn-s3-bucket-intelligenttieringconfiguration-prefix): String
  [Status](#cfn-s3-bucket-intelligenttieringconfiguration-status): String
  [TagFilters](#cfn-s3-bucket-intelligenttieringconfiguration-tagfilters): 
    - TagFilter
  [Tierings](#cfn-s3-bucket-intelligenttieringconfiguration-tierings): 
    - Tiering
```

## Properties
<a name="aws-properties-s3-bucket-intelligenttieringconfiguration-properties"></a>

`Id`  <a name="cfn-s3-bucket-intelligenttieringconfiguration-id"></a>
The ID used to identify the S3 Intelligent-Tiering configuration.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Prefix`  <a name="cfn-s3-bucket-intelligenttieringconfiguration-prefix"></a>
An object key name prefix that identifies the subset of objects to which the rule applies.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Status`  <a name="cfn-s3-bucket-intelligenttieringconfiguration-status"></a>
Specifies the status of the configuration.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `Disabled | Enabled`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TagFilters`  <a name="cfn-s3-bucket-intelligenttieringconfiguration-tagfilters"></a>
A container for a key-value pair.  
*Required*: No  
*Type*: Array of [TagFilter](aws-properties-s3-bucket-tagfilter.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tierings`  <a name="cfn-s3-bucket-intelligenttieringconfiguration-tierings"></a>
Specifies a list of S3 Intelligent-Tiering storage class tiers in the configuration. At least one tier must be defined in the list. At most, you can specify two tiers in the list, one for each available AccessTier: `ARCHIVE_ACCESS` and `DEEP_ARCHIVE_ACCESS`.  
You only need Intelligent Tiering Configuration enabled on a bucket if you want to automatically move objects stored in the Intelligent-Tiering storage class to Archive Access or Deep Archive Access tiers.
*Required*: Yes  
*Type*: Array of [Tiering](aws-properties-s3-bucket-tiering.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket InventoryConfiguration
<a name="aws-properties-s3-bucket-inventoryconfiguration"></a>

Specifies the S3 Inventory configuration for an Amazon S3 bucket. For more information, see [GET Bucket inventory](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETInventoryConfig.html) in the *Amazon S3 API Reference*. 

## Syntax
<a name="aws-properties-s3-bucket-inventoryconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-inventoryconfiguration-syntax.json"></a>

```
{
  "[Destination](#cfn-s3-bucket-inventoryconfiguration-destination)" : Destination,
  "[Enabled](#cfn-s3-bucket-inventoryconfiguration-enabled)" : Boolean,
  "[Id](#cfn-s3-bucket-inventoryconfiguration-id)" : String,
  "[IncludedObjectVersions](#cfn-s3-bucket-inventoryconfiguration-includedobjectversions)" : String,
  "[OptionalFields](#cfn-s3-bucket-inventoryconfiguration-optionalfields)" : [ String, ... ],
  "[Prefix](#cfn-s3-bucket-inventoryconfiguration-prefix)" : String,
  "[ScheduleFrequency](#cfn-s3-bucket-inventoryconfiguration-schedulefrequency)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-inventoryconfiguration-syntax.yaml"></a>

```
  [Destination](#cfn-s3-bucket-inventoryconfiguration-destination): 
    Destination
  [Enabled](#cfn-s3-bucket-inventoryconfiguration-enabled): Boolean
  [Id](#cfn-s3-bucket-inventoryconfiguration-id): String
  [IncludedObjectVersions](#cfn-s3-bucket-inventoryconfiguration-includedobjectversions): String
  [OptionalFields](#cfn-s3-bucket-inventoryconfiguration-optionalfields): 
    - String
  [Prefix](#cfn-s3-bucket-inventoryconfiguration-prefix): String
  [ScheduleFrequency](#cfn-s3-bucket-inventoryconfiguration-schedulefrequency): String
```

## Properties
<a name="aws-properties-s3-bucket-inventoryconfiguration-properties"></a>

`Destination`  <a name="cfn-s3-bucket-inventoryconfiguration-destination"></a>
Contains information about where to publish the inventory results.  
*Required*: Yes  
*Type*: [Destination](aws-properties-s3-bucket-destination.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Enabled`  <a name="cfn-s3-bucket-inventoryconfiguration-enabled"></a>
Specifies whether the inventory is enabled or disabled. If set to `True`, an inventory list is generated. If set to `False`, no inventory list is generated.  
*Required*: Yes  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Id`  <a name="cfn-s3-bucket-inventoryconfiguration-id"></a>
The ID used to identify the inventory configuration.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`IncludedObjectVersions`  <a name="cfn-s3-bucket-inventoryconfiguration-includedobjectversions"></a>
Object versions to include in the inventory list. If set to `All`, the list includes all the object versions, which adds the version-related fields `VersionId`, `IsLatest`, and `DeleteMarker` to the list. If set to `Current`, the list does not contain these version-related fields.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `All | Current`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`OptionalFields`  <a name="cfn-s3-bucket-inventoryconfiguration-optionalfields"></a>
Contains the optional fields that are included in the inventory results.  
*Required*: No  
*Type*: Array of String  
*Allowed values*: `Size | LastModifiedDate | StorageClass | ETag | IsMultipartUploaded | ReplicationStatus | EncryptionStatus | ObjectLockRetainUntilDate | ObjectLockMode | ObjectLockLegalHoldStatus | IntelligentTieringAccessTier | BucketKeyStatus | ChecksumAlgorithm | ObjectAccessControlList | ObjectOwner | LifecycleExpirationDate`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Prefix`  <a name="cfn-s3-bucket-inventoryconfiguration-prefix"></a>
Specifies the inventory filter prefix.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ScheduleFrequency`  <a name="cfn-s3-bucket-inventoryconfiguration-schedulefrequency"></a>
Specifies the schedule for generating inventory results.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `Daily | Weekly`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-inventoryconfiguration--examples"></a>



### Specify analytics and inventory configurations for an S3 bucket
<a name="aws-properties-s3-bucket-inventoryconfiguration--examples--Specify_analytics_and_inventory_configurations_for_an_S3_bucket"></a>

The following example specifies analytics and inventory results to be generated for an S3 bucket, including the format of the results and the destination bucket. The inventory list generates reports weekly and includes the current version of each object.

#### JSON
<a name="aws-properties-s3-bucket-inventoryconfiguration--examples--Specify_analytics_and_inventory_configurations_for_an_S3_bucket--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Description": "S3 Bucket with Inventory and Analytics Configurations",
    "Resources": {
        "Helper": {
            "Type": "AWS::S3::Bucket"
        },
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "AnalyticsConfigurations": [
                    {
                        "Id": "AnalyticsConfigurationId",
                        "StorageClassAnalysis": {
                            "DataExport": {
                                "Destination": {
                                    "BucketArn": {
                                        "Fn::GetAtt": [
                                            "Helper",
                                            "Arn"
                                        ]
                                    },
                                    "Format": "CSV",
                                    "Prefix": "AnalyticsDestinationPrefix"
                                },
                                "OutputSchemaVersion": "V_1"
                            }
                        },
                        "Prefix": "AnalyticsConfigurationPrefix",
                        "TagFilters": [
                            {
                                "Key": "AnalyticsTagKey",
                                "Value": "AnalyticsTagValue"
                            }
                        ]
                    }
                ],
                "InventoryConfigurations": [
                    {
                        "Id": "InventoryConfigurationId",
                        "Destination": {
                            "BucketArn": {
                                "Fn::GetAtt": [
                                    "Helper",
                                    "Arn"
                                ]
                            },
                            "Format": "CSV",
                            "Prefix": "InventoryDestinationPrefix"
                        },
                        "Enabled": true,
                        "IncludedObjectVersions": "Current",
                        "Prefix": "InventoryConfigurationPrefix",
                        "ScheduleFrequency": "Weekly"
                    }
                ]
            }
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-inventoryconfiguration--examples--Specify_analytics_and_inventory_configurations_for_an_S3_bucket--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Description: S3 Bucket with Inventory and Analytics Configurations
Resources:
  Helper:
    Type: 'AWS::S3::Bucket'
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      AnalyticsConfigurations:
        - Id: AnalyticsConfigurationId
          StorageClassAnalysis:
            DataExport:
              Destination:
                BucketArn: !GetAtt
                  - Helper
                  - Arn
                Format: CSV
                Prefix: AnalyticsDestinationPrefix
              OutputSchemaVersion: V_1
          Prefix: AnalyticsConfigurationPrefix
          TagFilters:
            - Key: AnalyticsTagKey
              Value: AnalyticsTagValue
      InventoryConfigurations:
        - Id: InventoryConfigurationId
          Destination:
            BucketArn: !GetAtt
              - Helper
              - Arn
            Format: CSV
            Prefix: InventoryDestinationPrefix
          Enabled: true
          IncludedObjectVersions: Current
          Prefix: InventoryConfigurationPrefix
          ScheduleFrequency: Weekly
```

# AWS::S3::Bucket InventoryTableConfiguration
<a name="aws-properties-s3-bucket-inventorytableconfiguration"></a>

 The inventory table configuration for an S3 Metadata configuration. 

## Syntax
<a name="aws-properties-s3-bucket-inventorytableconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-inventorytableconfiguration-syntax.json"></a>

```
{
  "[ConfigurationState](#cfn-s3-bucket-inventorytableconfiguration-configurationstate)" : String,
  "[EncryptionConfiguration](#cfn-s3-bucket-inventorytableconfiguration-encryptionconfiguration)" : MetadataTableEncryptionConfiguration,
  "[TableArn](#cfn-s3-bucket-inventorytableconfiguration-tablearn)" : String,
  "[TableName](#cfn-s3-bucket-inventorytableconfiguration-tablename)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-inventorytableconfiguration-syntax.yaml"></a>

```
  [ConfigurationState](#cfn-s3-bucket-inventorytableconfiguration-configurationstate): String
  [EncryptionConfiguration](#cfn-s3-bucket-inventorytableconfiguration-encryptionconfiguration): 
    MetadataTableEncryptionConfiguration
  [TableArn](#cfn-s3-bucket-inventorytableconfiguration-tablearn): String
  [TableName](#cfn-s3-bucket-inventorytableconfiguration-tablename): String
```

## Properties
<a name="aws-properties-s3-bucket-inventorytableconfiguration-properties"></a>

`ConfigurationState`  <a name="cfn-s3-bucket-inventorytableconfiguration-configurationstate"></a>
 The configuration state of the inventory table, indicating whether the inventory table is enabled or disabled.   
*Required*: Yes  
*Type*: String  
*Allowed values*: `ENABLED | DISABLED`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`EncryptionConfiguration`  <a name="cfn-s3-bucket-inventorytableconfiguration-encryptionconfiguration"></a>
 The encryption configuration for the inventory table.   
*Required*: No  
*Type*: [MetadataTableEncryptionConfiguration](aws-properties-s3-bucket-metadatatableencryptionconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TableArn`  <a name="cfn-s3-bucket-inventorytableconfiguration-tablearn"></a>
 The Amazon Resource Name (ARN) for the inventory table.   
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TableName`  <a name="cfn-s3-bucket-inventorytableconfiguration-tablename"></a>
 The name of the inventory table.   
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket JournalTableConfiguration
<a name="aws-properties-s3-bucket-journaltableconfiguration"></a>

 The journal table configuration for an S3 Metadata configuration. 

## Syntax
<a name="aws-properties-s3-bucket-journaltableconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-journaltableconfiguration-syntax.json"></a>

```
{
  "[EncryptionConfiguration](#cfn-s3-bucket-journaltableconfiguration-encryptionconfiguration)" : MetadataTableEncryptionConfiguration,
  "[RecordExpiration](#cfn-s3-bucket-journaltableconfiguration-recordexpiration)" : RecordExpiration,
  "[TableArn](#cfn-s3-bucket-journaltableconfiguration-tablearn)" : String,
  "[TableName](#cfn-s3-bucket-journaltableconfiguration-tablename)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-journaltableconfiguration-syntax.yaml"></a>

```
  [EncryptionConfiguration](#cfn-s3-bucket-journaltableconfiguration-encryptionconfiguration): 
    MetadataTableEncryptionConfiguration
  [RecordExpiration](#cfn-s3-bucket-journaltableconfiguration-recordexpiration): 
    RecordExpiration
  [TableArn](#cfn-s3-bucket-journaltableconfiguration-tablearn): String
  [TableName](#cfn-s3-bucket-journaltableconfiguration-tablename): String
```

## Properties
<a name="aws-properties-s3-bucket-journaltableconfiguration-properties"></a>

`EncryptionConfiguration`  <a name="cfn-s3-bucket-journaltableconfiguration-encryptionconfiguration"></a>
 The encryption configuration for the journal table.   
*Required*: No  
*Type*: [MetadataTableEncryptionConfiguration](aws-properties-s3-bucket-metadatatableencryptionconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RecordExpiration`  <a name="cfn-s3-bucket-journaltableconfiguration-recordexpiration"></a>
 The journal table record expiration settings for the journal table.   
*Required*: Yes  
*Type*: [RecordExpiration](aws-properties-s3-bucket-recordexpiration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TableArn`  <a name="cfn-s3-bucket-journaltableconfiguration-tablearn"></a>
 The Amazon Resource Name (ARN) for the journal table.   
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TableName`  <a name="cfn-s3-bucket-journaltableconfiguration-tablename"></a>
 The name of the journal table.   
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket LambdaConfiguration
<a name="aws-properties-s3-bucket-lambdaconfiguration"></a>

Describes the AWS Lambda functions to invoke and the events for which to invoke them.

## Syntax
<a name="aws-properties-s3-bucket-lambdaconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-lambdaconfiguration-syntax.json"></a>

```
{
  "[Event](#cfn-s3-bucket-lambdaconfiguration-event)" : String,
  "[Filter](#cfn-s3-bucket-lambdaconfiguration-filter)" : NotificationFilter,
  "[Function](#cfn-s3-bucket-lambdaconfiguration-function)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-lambdaconfiguration-syntax.yaml"></a>

```
  [Event](#cfn-s3-bucket-lambdaconfiguration-event): String
  [Filter](#cfn-s3-bucket-lambdaconfiguration-filter): 
    NotificationFilter
  [Function](#cfn-s3-bucket-lambdaconfiguration-function): String
```

## Properties
<a name="aws-properties-s3-bucket-lambdaconfiguration-properties"></a>

`Event`  <a name="cfn-s3-bucket-lambdaconfiguration-event"></a>
The Amazon S3 bucket event for which to invoke the AWS Lambda function. For more information, see [Supported Event Types](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) in the *Amazon S3 User Guide*.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Filter`  <a name="cfn-s3-bucket-lambdaconfiguration-filter"></a>
The filtering rules that determine which objects invoke the AWS Lambda function. For example, you can create a filter so that only image files with a `.jpg` extension invoke the function when they are added to the Amazon S3 bucket.  
*Required*: No  
*Type*: [NotificationFilter](aws-properties-s3-bucket-notificationfilter.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Function`  <a name="cfn-s3-bucket-lambdaconfiguration-function"></a>
The Amazon Resource Name (ARN) of the AWS Lambda function that Amazon S3 invokes when the specified event type occurs.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket LifecycleConfiguration
<a name="aws-properties-s3-bucket-lifecycleconfiguration"></a>

Specifies the lifecycle configuration for objects in an Amazon S3 bucket. For more information, see [Object Lifecycle Management](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) in the *Amazon S3 User Guide*.

## Syntax
<a name="aws-properties-s3-bucket-lifecycleconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-lifecycleconfiguration-syntax.json"></a>

```
{
  "[Rules](#cfn-s3-bucket-lifecycleconfiguration-rules)" : [ Rule, ... ],
  "[TransitionDefaultMinimumObjectSize](#cfn-s3-bucket-lifecycleconfiguration-transitiondefaultminimumobjectsize)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-lifecycleconfiguration-syntax.yaml"></a>

```
  [Rules](#cfn-s3-bucket-lifecycleconfiguration-rules): 
    - Rule
  [TransitionDefaultMinimumObjectSize](#cfn-s3-bucket-lifecycleconfiguration-transitiondefaultminimumobjectsize): String
```

## Properties
<a name="aws-properties-s3-bucket-lifecycleconfiguration-properties"></a>

`Rules`  <a name="cfn-s3-bucket-lifecycleconfiguration-rules"></a>
A lifecycle rule for individual objects in an Amazon S3 bucket.  
*Required*: Yes  
*Type*: Array of [Rule](aws-properties-s3-bucket-rule.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TransitionDefaultMinimumObjectSize`  <a name="cfn-s3-bucket-lifecycleconfiguration-transitiondefaultminimumobjectsize"></a>
Indicates which default minimum object size behavior is applied to the lifecycle configuration.  
This parameter applies to general purpose buckets only. It isn't supported for directory bucket lifecycle configurations.
+ `all_storage_classes_128K` - Objects smaller than 128 KB will not transition to any storage class by default.
+ `varies_by_storage_class` - Objects smaller than 128 KB will transition to Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, all other storage classes will prevent transitions smaller than 128 KB. 
To customize the minimum object size for any transition you can add a filter that specifies a custom `ObjectSizeGreaterThan` or `ObjectSizeLessThan` in the body of your transition rule. Custom filters always take precedence over the default transition behavior.  
*Required*: No  
*Type*: String  
*Allowed values*: `varies_by_storage_class | all_storage_classes_128K`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-lifecycleconfiguration--examples"></a>



### Manage the lifecycle for S3 objects
<a name="aws-properties-s3-bucket-lifecycleconfiguration--examples--Manage_the_lifecycle_for_S3_objects"></a>

The following example template shows an S3 bucket with a lifecycle configuration rule. The rule applies to all objects with the `glacier` key prefix. The objects are transitioned to Glacier after one day, and deleted after one year.

#### JSON
<a name="aws-properties-s3-bucket-lifecycleconfiguration--examples--Manage_the_lifecycle_for_S3_objects--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "AccessControl": "Private",
                "LifecycleConfiguration": {
                    "Rules": [
                        {
                            "Id": "GlacierRule",
                            "Prefix": "glacier",
                            "Status": "Enabled",
                            "ExpirationInDays": 365,
                            "Transitions": [
                                {
                                    "TransitionInDays": 1,
                                    "StorageClass": "GLACIER"
                                }
                            ]
                        }
                    ]
                }
            }
        }
    },
    "Outputs": {
        "BucketName": {
            "Value": {
                "Ref": "S3Bucket"
            },
            "Description": "Name of the sample Amazon S3 bucket with a lifecycle configuration."
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-lifecycleconfiguration--examples--Manage_the_lifecycle_for_S3_objects--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      AccessControl: Private
      LifecycleConfiguration:
        Rules:
          - Id: GlacierRule
            Prefix: glacier
            Status: Enabled
            ExpirationInDays: 365
            Transitions:
              - TransitionInDays: 1
                StorageClass: GLACIER
Outputs:
  BucketName:
    Value: !Ref S3Bucket
    Description: Name of the sample Amazon S3 bucket with a lifecycle configuration.
```

# AWS::S3::Bucket LoggingConfiguration
<a name="aws-properties-s3-bucket-loggingconfiguration"></a>

Describes where logs are stored and the prefix that Amazon S3 assigns to all log object keys for a bucket. For examples and more information, see [PUT Bucket logging](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html) in the *Amazon S3 API Reference*.

**Note**  
To successfully complete the `AWS::S3::Bucket LoggingConfiguration` request, you must have `s3:PutObject` and `s3:PutObjectAcl` in your IAM permissions.

## Syntax
<a name="aws-properties-s3-bucket-loggingconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-loggingconfiguration-syntax.json"></a>

```
{
  "[DestinationBucketName](#cfn-s3-bucket-loggingconfiguration-destinationbucketname)" : String,
  "[LogFilePrefix](#cfn-s3-bucket-loggingconfiguration-logfileprefix)" : String,
  "[TargetObjectKeyFormat](#cfn-s3-bucket-loggingconfiguration-targetobjectkeyformat)" : TargetObjectKeyFormat
}
```

### YAML
<a name="aws-properties-s3-bucket-loggingconfiguration-syntax.yaml"></a>

```
  [DestinationBucketName](#cfn-s3-bucket-loggingconfiguration-destinationbucketname): String
  [LogFilePrefix](#cfn-s3-bucket-loggingconfiguration-logfileprefix): String
  [TargetObjectKeyFormat](#cfn-s3-bucket-loggingconfiguration-targetobjectkeyformat): 
    TargetObjectKeyFormat
```

## Properties
<a name="aws-properties-s3-bucket-loggingconfiguration-properties"></a>

`DestinationBucketName`  <a name="cfn-s3-bucket-loggingconfiguration-destinationbucketname"></a>
The name of the bucket where Amazon S3 should store server access log files. You can store log files in any bucket that you own. By default, logs are stored in the bucket where the `LoggingConfiguration` property is defined.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`LogFilePrefix`  <a name="cfn-s3-bucket-loggingconfiguration-logfileprefix"></a>
A prefix for all log object keys. If you store log files from multiple Amazon S3 buckets in a single bucket, you can use a prefix to distinguish which log files came from which bucket.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TargetObjectKeyFormat`  <a name="cfn-s3-bucket-loggingconfiguration-targetobjectkeyformat"></a>
Amazon S3 key format for log objects. Only one format, either PartitionedPrefix or SimplePrefix, is allowed.  
*Required*: No  
*Type*: [TargetObjectKeyFormat](aws-properties-s3-bucket-targetobjectkeyformat.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-loggingconfiguration--examples"></a>



**Topics**
+ [Log access requests for a specific S3 bucket](#aws-properties-s3-bucket-loggingconfiguration--examples--Log_access_requests_for_a_specific_S3_bucket)
+ [Setting up logging configurations with log prefixes based on event time](#aws-properties-s3-bucket-loggingconfiguration--examples--Setting_up_logging_configurations_with_log_prefixes_based_on_event_time)
+ [Setting up logging configurations with log prefixes based on delivery time](#aws-properties-s3-bucket-loggingconfiguration--examples--Setting_up_logging_configurations_with_log_prefixes_based_on_delivery_time)
+ [Setting up logging configurations with a simple prefix](#aws-properties-s3-bucket-loggingconfiguration--examples--Setting_up_logging_configurations_with_a_simple_prefix)

### Log access requests for a specific S3 bucket
<a name="aws-properties-s3-bucket-loggingconfiguration--examples--Log_access_requests_for_a_specific_S3_bucket"></a>

The following example template creates two S3 buckets. The `LoggingBucket` bucket store the logs from the `S3Bucket` bucket. To receive logs from the `S3Bucket` bucket, the logging bucket requires log delivery write permissions.

#### JSON
<a name="aws-properties-s3-bucket-loggingconfiguration--examples--Log_access_requests_for_a_specific_S3_bucket--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "LoggingConfiguration": {
                    "DestinationBucketName": {
                        "Ref": "LoggingBucket"
                    },
                    "LogFilePrefix": "testing-logs"
                }
            }
        },
        "LoggingBucket": {
            "Type": "AWS::S3::Bucket"
        },
        "S3BucketPolicy": {
            "Type": "AWS::S3::BucketPolicy",
            "Properties": {
                "Bucket": {
                    "Ref": "LoggingBucket"
                },
                "PolicyDocument": {
                    "Version": "2012-10-17"		 	 	 ,
                    "Statement": [
                        {
                            "Action": [
                                "s3:PutObject"
                            ],
                            "Effect": "Allow",
                            "Principal": {
                                "Service": "logging.s3.amazonaws.com"
                            },
                            "Resource": {
                                "Fn::Join": [
                                    "",
                                    [
                                        "arn:aws:s3:::",
                                        {
                                            "Ref": "LoggingBucket"
                                        },
                                        "/*"
                                    ]
                                ]
                            },
                            "Condition": {
                                "ArnLike": {
                                    "aws:SourceArn": {
                                        "Fn::GetAtt": [
                                            "S3Bucket",
                                            "Arn"
                                        ]
                                    }
                                },
                                "StringEquals": {
                                    "aws:SourceAccount": {
                                        "Fn::Sub": "${AWS::AccountId}"
                                    }
                                }
                            }
                        }
                    ]
                }
            }
        }
    },
    "Outputs": {
        "BucketName": {
            "Value": {
                "Ref": "S3Bucket"
            },
            "Description": "Name of the sample Amazon S3 bucket with a logging configuration."
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-loggingconfiguration--examples--Log_access_requests_for_a_specific_S3_bucket--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      LoggingConfiguration:
        DestinationBucketName: !Ref LoggingBucket
        LogFilePrefix: testing-logs
  LoggingBucket:
    Type: 'AWS::S3::Bucket'
  S3BucketPolicy:
    Type: 'AWS::S3::BucketPolicy'
    Properties:
      Bucket: !Ref LoggingBucket
      PolicyDocument:
        Version: 2012-10-17
        Statement:
          - Action:
              - 's3:PutObject'
            Effect: Allow
            Principal:
              Service: logging.s3.amazonaws.com
            Resource: !Join 
              - ''
              - - 'arn:aws:s3:::'
                - !Ref LoggingBucket
                - /*
            Condition:
              ArnLike:
                'aws:SourceArn': !GetAtt 
                  - S3Bucket
                  - Arn
              StringEquals:
                'aws:SourceAccount': !Sub '${AWS::AccountId}'
Outputs:
  BucketName:
    Value: !Ref S3Bucket
    Description: Name of the sample Amazon S3 bucket with a logging configuration.
```

### Setting up logging configurations with log prefixes based on event time
<a name="aws-properties-s3-bucket-loggingconfiguration--examples--Setting_up_logging_configurations_with_log_prefixes_based_on_event_time"></a>

The following example template configures the `DOC-EXAMPLE-BUCKET` destination bucket with a `logs/` prefix and event time log delivery.

#### JSON
<a name="aws-properties-s3-bucket-loggingconfiguration--examples--Setting_up_logging_configurations_with_log_prefixes_based_on_event_time--json"></a>

```
        "LoggingConfiguration": {
            "DestinationBucketName": "DOC-EXAMPLE-BUCKET",
            "LogFilePrefix": "logs/",
            "TargetObjectKeyFormat": {
                "PartitionedPrefix": {
                    "PartitionDateSource": "EventTime"
                }
            }
        }
```

#### YAML
<a name="aws-properties-s3-bucket-loggingconfiguration--examples--Setting_up_logging_configurations_with_log_prefixes_based_on_event_time--yaml"></a>

```
        LoggingConfiguration:
          DestinationBucketName: "DOC-EXAMPLE-BUCKET"
          LogFilePrefix: logs/
          TargetObjectKeyFormat:
            PartitionedPrefix:
              PartitionDateSource: EventTime
```

### Setting up logging configurations with log prefixes based on delivery time
<a name="aws-properties-s3-bucket-loggingconfiguration--examples--Setting_up_logging_configurations_with_log_prefixes_based_on_delivery_time"></a>

The following example template configures the `DOC-EXAMPLE-BUCKET` destination bucket with a `logs/` prefix and delivery time log delivery.

#### JSON
<a name="aws-properties-s3-bucket-loggingconfiguration--examples--Setting_up_logging_configurations_with_log_prefixes_based_on_delivery_time--json"></a>

```
        "LoggingConfiguration": {
            "DestinationBucketName": "DOC-EXAMPLE-BUCKET",
            "LogFilePrefix": "logs/",
            "TargetObjectKeyFormat": {
                "PartitionedPrefix": {
                    "PartitionDateSource": "DeliveryTime"
                }
            }
        }
```

#### YAML
<a name="aws-properties-s3-bucket-loggingconfiguration--examples--Setting_up_logging_configurations_with_log_prefixes_based_on_delivery_time--yaml"></a>

```
        LoggingConfiguration:
          DestinationBucketName: "DOC-EXAMPLE-BUCKET"
          LogFilePrefix: logs/
          TargetObjectKeyFormat:
            PartitionedPrefix:
              PartitionDateSource: DeliveryTime
```

### Setting up logging configurations with a simple prefix
<a name="aws-properties-s3-bucket-loggingconfiguration--examples--Setting_up_logging_configurations_with_a_simple_prefix"></a>

The following example template configures the `DOC-EXAMPLE-BUCKET` destination bucket with a `logs/` prefix and simple prefix delivery.

#### JSON
<a name="aws-properties-s3-bucket-loggingconfiguration--examples--Setting_up_logging_configurations_with_a_simple_prefix--json"></a>

```
        "LoggingConfiguration": {
            "DestinationBucketName": "DOC-EXAMPLE-BUCKET",
            "LogFilePrefix": "logs/",
            "TargetObjectKeyFormat": {
                "SimplePrefix": {}
            }
        }
```

#### YAML
<a name="aws-properties-s3-bucket-loggingconfiguration--examples--Setting_up_logging_configurations_with_a_simple_prefix--yaml"></a>

```
        LoggingConfiguration:
          DestinationBucketName: "DOC-EXAMPLE-BUCKET"
          LogFilePrefix: logs/
          TargetObjectKeyFormat:
            SimplePrefix: {}
```

# AWS::S3::Bucket MetadataConfiguration
<a name="aws-properties-s3-bucket-metadataconfiguration"></a>

 Creates a V2 Amazon S3 Metadata configuration of a general purpose bucket. For more information, see [ Accelerating data discovery with S3 Metadata](https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-overview.html) in the *Amazon S3 User Guide*. 

## Syntax
<a name="aws-properties-s3-bucket-metadataconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-metadataconfiguration-syntax.json"></a>

```
{
  "[Destination](#cfn-s3-bucket-metadataconfiguration-destination)" : MetadataDestination,
  "[InventoryTableConfiguration](#cfn-s3-bucket-metadataconfiguration-inventorytableconfiguration)" : InventoryTableConfiguration,
  "[JournalTableConfiguration](#cfn-s3-bucket-metadataconfiguration-journaltableconfiguration)" : JournalTableConfiguration
}
```

### YAML
<a name="aws-properties-s3-bucket-metadataconfiguration-syntax.yaml"></a>

```
  [Destination](#cfn-s3-bucket-metadataconfiguration-destination): 
    MetadataDestination
  [InventoryTableConfiguration](#cfn-s3-bucket-metadataconfiguration-inventorytableconfiguration): 
    InventoryTableConfiguration
  [JournalTableConfiguration](#cfn-s3-bucket-metadataconfiguration-journaltableconfiguration): 
    JournalTableConfiguration
```

## Properties
<a name="aws-properties-s3-bucket-metadataconfiguration-properties"></a>

`Destination`  <a name="cfn-s3-bucket-metadataconfiguration-destination"></a>
 The destination information for the S3 Metadata configuration.   
*Required*: No  
*Type*: [MetadataDestination](aws-properties-s3-bucket-metadatadestination.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`InventoryTableConfiguration`  <a name="cfn-s3-bucket-metadataconfiguration-inventorytableconfiguration"></a>
 The inventory table configuration for a metadata configuration.   
*Required*: No  
*Type*: [InventoryTableConfiguration](aws-properties-s3-bucket-inventorytableconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`JournalTableConfiguration`  <a name="cfn-s3-bucket-metadataconfiguration-journaltableconfiguration"></a>
 The journal table configuration for a metadata configuration.   
*Required*: Yes  
*Type*: [JournalTableConfiguration](aws-properties-s3-bucket-journaltableconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-metadataconfiguration--examples"></a>



### Create a metadata configuration
<a name="aws-properties-s3-bucket-metadataconfiguration--examples--Create_a_metadata_configuration"></a>

The following example creates an S3 Metadata configuration for the specified general purpose bucket. To use this example, replace ` amzn-s3-demo-bucket ` with the name of your general purpose bucket. Also make sure to update the AWS Identity and Access Management (IAM) Amazon Resource Name (ARN) with the name of the IAM role that you want to use.

#### JSON
<a name="aws-properties-s3-bucket-metadataconfiguration--examples--Create_a_metadata_configuration--json"></a>

```
{
  "Resources": {
    "S3MetadataKMSKey": {
      "Type": "AWS::KMS::Key",
      "Properties": {
        "Description": "KMS key for S3 metadata encryption",
        "EnableKeyRotation": true,
        "KeyPolicy": {
          "Version": "2012-10-17",		 	 	 
          "Statement": [
            {
              "Sid": "Enable IAM User Permissions",
              "Effect": "Allow",
              "Principal": {
                "AWS": {
                  "Fn::Sub": "arn:aws:iam::${AWS::AccountId}:role/SpecificRoleName"
                }
              },
              "Action": "kms:*",
              "Resource": "*"
            },
            {
              "Sid": "Allow S3 Metadata Service",
              "Effect": "Allow",
              "Principal": {
                "Service": [
                  "maintenance.s3tables.amazonaws.com",
                  "metadata.s3.amazonaws.com"
                ]
              },
              "Action": [
                "kms:Decrypt",
                "kms:GenerateDataKey"
              ],
              "Resource": "*"
            }
          ]
        }
      }
    },
    "S3MetadataKMSKeyAlias": {
      "Type": "AWS::KMS::Alias",
      "Properties": {
        "AliasName": "alias/s3-metadata-key",
        "TargetKeyId": {
          "Ref": "S3MetadataKMSKey"
        }
      }
    },
    "TestMetadataBucket": {
      "Type": "AWS::S3::Bucket",
      "Properties": {
        "BucketName": "amzn-s3-demo-bucket",
        "MetadataConfiguration": {
          "JournalTableConfiguration": {
            "RecordExpiration": {
              "Expiration": "ENABLED",
              "Days": 10
            },
            "EncryptionConfiguration": {
              "SseAlgorithm": "aws:kms",
              "KmsKeyArn": {
                "Fn::GetAtt": [
                  "S3MetadataKMSKey",
                  "Arn"
                ]
              }
            }
          },
          "InventoryTableConfiguration": {
            "ConfigurationState": "ENABLED",
            "EncryptionConfiguration": {
              "SseAlgorithm": "aws:kms",
              "KmsKeyArn": {
                "Fn::GetAtt": [
                  "S3MetadataKMSKey",
                  "Arn"
                ]
              }
            }
          }
        }
      }
    }
  }
}
```

#### YAML
<a name="aws-properties-s3-bucket-metadataconfiguration--examples--Create_a_metadata_configuration--yaml"></a>

```
Resources:
  S3MetadataKMSKey:
    Type: 'AWS::KMS::Key'
    Properties:
      Description: 'KMS key for S3 metadata encryption'
      EnableKeyRotation: true
      KeyPolicy:
        Version: '2012-10-17		 	 	 '
        Statement:
          - Sid: 'Enable IAM User Permissions'
            Effect: Allow
            Principal:
              AWS: !Sub 'arn:aws:iam::${AWS::AccountId}:role/SpecificRoleName'
            Action: 'kms:*'
            Resource: '*'
          - Sid: 'Allow S3 Metadata Service'
            Effect: Allow
            Principal:
              Service: 
                - 'maintenance.s3tables.amazonaws.com'
                - 'metadata.s3.amazonaws.com'
            Action:
              - 'kms:Decrypt'
              - 'kms:GenerateDataKey'
            Resource: '*'

  S3MetadataKMSKeyAlias:
    Type: 'AWS::KMS::Alias'
    Properties:
      AliasName: 'alias/s3-metadata-key'
      TargetKeyId: !Ref S3MetadataKMSKey

  TestMetadataBucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      BucketName: amzn-s3-demo-bucket
      MetadataConfiguration:
        JournalTableConfiguration:
          RecordExpiration:
            Expiration: ENABLED
            Days: 10
          EncryptionConfiguration:
            SseAlgorithm: aws:kms
            KmsKeyArn: !GetAtt S3MetadataKMSKey.Arn
        InventoryTableConfiguration:
          ConfigurationState: ENABLED
          EncryptionConfiguration:
            SseAlgorithm: aws:kms
            KmsKeyArn: !GetAtt S3MetadataKMSKey.Arn
```

# AWS::S3::Bucket MetadataDestination
<a name="aws-properties-s3-bucket-metadatadestination"></a>

 The destination information for the S3 Metadata configuration. 

## Syntax
<a name="aws-properties-s3-bucket-metadatadestination-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-metadatadestination-syntax.json"></a>

```
{
  "[TableBucketArn](#cfn-s3-bucket-metadatadestination-tablebucketarn)" : String,
  "[TableBucketType](#cfn-s3-bucket-metadatadestination-tablebuckettype)" : String,
  "[TableNamespace](#cfn-s3-bucket-metadatadestination-tablenamespace)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-metadatadestination-syntax.yaml"></a>

```
  [TableBucketArn](#cfn-s3-bucket-metadatadestination-tablebucketarn): String
  [TableBucketType](#cfn-s3-bucket-metadatadestination-tablebuckettype): String
  [TableNamespace](#cfn-s3-bucket-metadatadestination-tablenamespace): String
```

## Properties
<a name="aws-properties-s3-bucket-metadatadestination-properties"></a>

`TableBucketArn`  <a name="cfn-s3-bucket-metadatadestination-tablebucketarn"></a>
 The Amazon Resource Name (ARN) of the table bucket where the metadata configuration is stored.   
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TableBucketType`  <a name="cfn-s3-bucket-metadatadestination-tablebuckettype"></a>
 The type of the table bucket where the metadata configuration is stored. The `aws` value indicates an AWS managed table bucket, and the `customer` value indicates a customer-managed table bucket. V2 metadata configurations are stored in AWS managed table buckets, and V1 metadata configurations are stored in customer-managed table buckets.   
*Required*: Yes  
*Type*: String  
*Allowed values*: `aws | customer`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TableNamespace`  <a name="cfn-s3-bucket-metadatadestination-tablenamespace"></a>
 The namespace in the table bucket where the metadata tables for a metadata configuration are stored.   
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket MetadataTableConfiguration
<a name="aws-properties-s3-bucket-metadatatableconfiguration"></a>

**Important**  
 We recommend that you create your S3 Metadata configurations by using the V2 [ MetadataConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-properties-s3-bucket-metadataconfiguration.html) resource type. We no longer recommend using the V1 `MetadataTableConfiguration` resource type.   
If you created your S3 Metadata configuration before July 15, 2025, we recommend that you delete and re-create your configuration by using the [ MetadataConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-properties-s3-bucket-metadataconfiguration.html) resource type so that you can expire journal table records and create a live inventory table.

Creates a V1 S3 Metadata configuration for a general purpose bucket. For more information, see [Accelerating data discovery with S3 Metadata](https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-overview.html) in the *Amazon S3 User Guide*.

## Syntax
<a name="aws-properties-s3-bucket-metadatatableconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-metadatatableconfiguration-syntax.json"></a>

```
{
  "[S3TablesDestination](#cfn-s3-bucket-metadatatableconfiguration-s3tablesdestination)" : S3TablesDestination
}
```

### YAML
<a name="aws-properties-s3-bucket-metadatatableconfiguration-syntax.yaml"></a>

```
  [S3TablesDestination](#cfn-s3-bucket-metadatatableconfiguration-s3tablesdestination): 
    S3TablesDestination
```

## Properties
<a name="aws-properties-s3-bucket-metadatatableconfiguration-properties"></a>

`S3TablesDestination`  <a name="cfn-s3-bucket-metadatatableconfiguration-s3tablesdestination"></a>
 The destination information for the metadata table configuration. The destination table bucket must be in the same Region and AWS account as the general purpose bucket. The specified metadata table name must be unique within the `aws_s3_metadata` namespace in the destination table bucket.   
*Required*: Yes  
*Type*: [S3TablesDestination](aws-properties-s3-bucket-s3tablesdestination.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-metadatatableconfiguration--examples"></a>



### Create metadata table configuration
<a name="aws-properties-s3-bucket-metadatatableconfiguration--examples--Create_metadata_table_configuration"></a>

The following example creates an S3 Metadata configuration for the specified general purpose bucket. To use this example, replace ` amzn-s3-demo-table-bucket ` with the name of the table bucket where you want to store your metadata table, replace ` amzn-s3-demo-bucket1 ` with the name of your general purpose bucket, and replace `my_metadata_table_name` with the name that you want to use for your metadata table. 

#### JSON
<a name="aws-properties-s3-bucket-metadatatableconfiguration--examples--Create_metadata_table_configuration--json"></a>

```
{
  "Resources": {
    "S3TableBucket": {
      "Type": "AWS::S3Tables::TableBucket",
      "Properties": {
        "TableBucketName": "amzn-s3-demo-table-bucket"
      }
    },
    "S3Bucket": {
      "Type": "AWS::S3::Bucket",
      "DeletionPolicy": "Retain",
      "Properties": {
        "BucketName": "amzn-s3-demo-bucket1",
        "MetadataTableConfiguration": {
          "S3TablesDestination": {
            "TableBucketArn": {
              "Fn::GetAtt": [
                "S3TableBucket",
                "TableBucketARN"
              ]
            },
            "TableName": "my_metadata_table_name",
            "TableNamespace": "aws_s3_metadata"
          }
        }
      }
    }
  }
}
```

#### YAML
<a name="aws-properties-s3-bucket-metadatatableconfiguration--examples--Create_metadata_table_configuration--yaml"></a>

```
Resources:
  S3TableBucket:
    Type: AWS::S3Tables::TableBucket
    Properties:
      TableBucketName: amzn-s3-demo-table-bucket

  S3Bucket:
    Type: AWS::S3::Bucket
    DeletionPolicy: Retain
    Properties:
      BucketName: amzn-s3-demo-bucket1
      MetadataTableConfiguration: 
        S3TablesDestination: 
          TableBucketArn: !GetAtt S3TableBucket.TableBucketARN
          TableName: my_metadata_table_name
          TableNamespace: aws_s3_metadata
```

# AWS::S3::Bucket MetadataTableEncryptionConfiguration
<a name="aws-properties-s3-bucket-metadatatableencryptionconfiguration"></a>

 The encryption settings for an S3 Metadata journal table or inventory table configuration. 

## Syntax
<a name="aws-properties-s3-bucket-metadatatableencryptionconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-metadatatableencryptionconfiguration-syntax.json"></a>

```
{
  "[KmsKeyArn](#cfn-s3-bucket-metadatatableencryptionconfiguration-kmskeyarn)" : String,
  "[SseAlgorithm](#cfn-s3-bucket-metadatatableencryptionconfiguration-ssealgorithm)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-metadatatableencryptionconfiguration-syntax.yaml"></a>

```
  [KmsKeyArn](#cfn-s3-bucket-metadatatableencryptionconfiguration-kmskeyarn): String
  [SseAlgorithm](#cfn-s3-bucket-metadatatableencryptionconfiguration-ssealgorithm): String
```

## Properties
<a name="aws-properties-s3-bucket-metadatatableencryptionconfiguration-properties"></a>

`KmsKeyArn`  <a name="cfn-s3-bucket-metadatatableencryptionconfiguration-kmskeyarn"></a>
 If server-side encryption with AWS Key Management Service (AWS KMS) keys (SSE-KMS) is specified, you must also specify the KMS key Amazon Resource Name (ARN). You must specify a customer-managed KMS key that's located in the same Region as the general purpose bucket that corresponds to the metadata table configuration.   
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SseAlgorithm`  <a name="cfn-s3-bucket-metadatatableencryptionconfiguration-ssealgorithm"></a>
 The encryption type specified for a metadata table. To specify server-side encryption with AWS Key Management Service (AWS KMS) keys (SSE-KMS), use the `aws:kms` value. To specify server-side encryption with Amazon S3 managed keys (SSE-S3), use the `AES256` value.   
*Required*: Yes  
*Type*: String  
*Allowed values*: `aws:kms | AES256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket Metrics
<a name="aws-properties-s3-bucket-metrics"></a>

 A container specifying replication metrics-related settings enabling replication metrics and events.

## Syntax
<a name="aws-properties-s3-bucket-metrics-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-metrics-syntax.json"></a>

```
{
  "[EventThreshold](#cfn-s3-bucket-metrics-eventthreshold)" : ReplicationTimeValue,
  "[Status](#cfn-s3-bucket-metrics-status)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-metrics-syntax.yaml"></a>

```
  [EventThreshold](#cfn-s3-bucket-metrics-eventthreshold): 
    ReplicationTimeValue
  [Status](#cfn-s3-bucket-metrics-status): String
```

## Properties
<a name="aws-properties-s3-bucket-metrics-properties"></a>

`EventThreshold`  <a name="cfn-s3-bucket-metrics-eventthreshold"></a>
 A container specifying the time threshold for emitting the `s3:Replication:OperationMissedThreshold` event.   
*Required*: No  
*Type*: [ReplicationTimeValue](aws-properties-s3-bucket-replicationtimevalue.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Status`  <a name="cfn-s3-bucket-metrics-status"></a>
 Specifies whether the replication metrics are enabled.   
*Required*: Yes  
*Type*: String  
*Allowed values*: `Disabled | Enabled`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## See also
<a name="aws-properties-s3-bucket-metrics--seealso"></a>
+ AWS::S3::Bucket [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#aws-properties-s3-bucket--examples)



# AWS::S3::Bucket MetricsConfiguration
<a name="aws-properties-s3-bucket-metricsconfiguration"></a>

Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket. If you're updating an existing metrics configuration, note that this is a full replacement of the existing metrics configuration. If you don't include the elements you want to keep, they are erased. For examples, see [AWS::S3::Bucket](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#aws-properties-s3-bucket--examples). For more information, see [ PUT Bucket metrics](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTMetricConfiguration.html) in the *Amazon S3 API Reference*.

## Syntax
<a name="aws-properties-s3-bucket-metricsconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-metricsconfiguration-syntax.json"></a>

```
{
  "[AccessPointArn](#cfn-s3-bucket-metricsconfiguration-accesspointarn)" : String,
  "[Id](#cfn-s3-bucket-metricsconfiguration-id)" : String,
  "[Prefix](#cfn-s3-bucket-metricsconfiguration-prefix)" : String,
  "[TagFilters](#cfn-s3-bucket-metricsconfiguration-tagfilters)" : [ TagFilter, ... ]
}
```

### YAML
<a name="aws-properties-s3-bucket-metricsconfiguration-syntax.yaml"></a>

```
  [AccessPointArn](#cfn-s3-bucket-metricsconfiguration-accesspointarn): String
  [Id](#cfn-s3-bucket-metricsconfiguration-id): String
  [Prefix](#cfn-s3-bucket-metricsconfiguration-prefix): String
  [TagFilters](#cfn-s3-bucket-metricsconfiguration-tagfilters): 
    - TagFilter
```

## Properties
<a name="aws-properties-s3-bucket-metricsconfiguration-properties"></a>

`AccessPointArn`  <a name="cfn-s3-bucket-metricsconfiguration-accesspointarn"></a>
The access point that was used while performing operations on the object. The metrics configuration only includes objects that meet the filter's criteria.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Id`  <a name="cfn-s3-bucket-metricsconfiguration-id"></a>
The ID used to identify the metrics configuration. This can be any value you choose that helps you identify your metrics configuration.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Prefix`  <a name="cfn-s3-bucket-metricsconfiguration-prefix"></a>
The prefix that an object must have to be included in the metrics results.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TagFilters`  <a name="cfn-s3-bucket-metricsconfiguration-tagfilters"></a>
Specifies a list of tag filters to use as a metrics configuration filter. The metrics configuration includes only objects that meet the filter's criteria.  
*Required*: No  
*Type*: Array of [TagFilter](aws-properties-s3-bucket-tagfilter.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## See also
<a name="aws-properties-s3-bucket-metricsconfiguration--seealso"></a>
+ AWS::S3::Bucket [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#aws-properties-s3-bucket--examples)



# AWS::S3::Bucket NoncurrentVersionExpiration
<a name="aws-properties-s3-bucket-noncurrentversionexpiration"></a>

Specifies when noncurrent object versions expire. Upon expiration, Amazon S3 permanently deletes the noncurrent object versions. You set this lifecycle configuration action on a bucket that has versioning enabled (or suspended) to request that Amazon S3 delete noncurrent object versions at a specific period in the object's lifetime. For more information about setting a lifecycle rule configuration, see [AWS::S3::Bucket Rule](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html).

## Syntax
<a name="aws-properties-s3-bucket-noncurrentversionexpiration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-noncurrentversionexpiration-syntax.json"></a>

```
{
  "[NewerNoncurrentVersions](#cfn-s3-bucket-noncurrentversionexpiration-newernoncurrentversions)" : Integer,
  "[NoncurrentDays](#cfn-s3-bucket-noncurrentversionexpiration-noncurrentdays)" : Integer
}
```

### YAML
<a name="aws-properties-s3-bucket-noncurrentversionexpiration-syntax.yaml"></a>

```
  [NewerNoncurrentVersions](#cfn-s3-bucket-noncurrentversionexpiration-newernoncurrentversions): Integer
  [NoncurrentDays](#cfn-s3-bucket-noncurrentversionexpiration-noncurrentdays): Integer
```

## Properties
<a name="aws-properties-s3-bucket-noncurrentversionexpiration-properties"></a>

`NewerNoncurrentVersions`  <a name="cfn-s3-bucket-noncurrentversionexpiration-newernoncurrentversions"></a>
Specifies how many noncurrent versions Amazon S3 will retain. If there are this many more recent noncurrent versions, Amazon S3 will take the associated action. For more information about noncurrent versions, see [Lifecycle configuration elements](https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html) in the *Amazon S3 User Guide*.  
*Required*: No  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`NoncurrentDays`  <a name="cfn-s3-bucket-noncurrentversionexpiration-noncurrentdays"></a>
Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. For information about the noncurrent days calculations, see [How Amazon S3 Calculates When an Object Became Noncurrent](https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations) in the *Amazon S3 User Guide*.  
*Required*: Yes  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket NoncurrentVersionTransition
<a name="aws-properties-s3-bucket-noncurrentversiontransition"></a>

Container for the transition rule that describes when noncurrent objects transition to the `STANDARD_IA`, `ONEZONE_IA`, `INTELLIGENT_TIERING`, `GLACIER_IR`, `GLACIER`, or `DEEP_ARCHIVE` storage class. If your bucket is versioning-enabled (or versioning is suspended), you can set this action to request that Amazon S3 transition noncurrent object versions to the `STANDARD_IA`, `ONEZONE_IA`, `INTELLIGENT_TIERING`, `GLACIER_IR`, `GLACIER`, or `DEEP_ARCHIVE` storage class at a specific period in the object's lifetime. If you specify this property, don't specify the `NoncurrentVersionTransitions` property.

## Syntax
<a name="aws-properties-s3-bucket-noncurrentversiontransition-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-noncurrentversiontransition-syntax.json"></a>

```
{
  "[NewerNoncurrentVersions](#cfn-s3-bucket-noncurrentversiontransition-newernoncurrentversions)" : Integer,
  "[StorageClass](#cfn-s3-bucket-noncurrentversiontransition-storageclass)" : String,
  "[TransitionInDays](#cfn-s3-bucket-noncurrentversiontransition-transitionindays)" : Integer
}
```

### YAML
<a name="aws-properties-s3-bucket-noncurrentversiontransition-syntax.yaml"></a>

```
  [NewerNoncurrentVersions](#cfn-s3-bucket-noncurrentversiontransition-newernoncurrentversions): Integer
  [StorageClass](#cfn-s3-bucket-noncurrentversiontransition-storageclass): String
  [TransitionInDays](#cfn-s3-bucket-noncurrentversiontransition-transitionindays): Integer
```

## Properties
<a name="aws-properties-s3-bucket-noncurrentversiontransition-properties"></a>

`NewerNoncurrentVersions`  <a name="cfn-s3-bucket-noncurrentversiontransition-newernoncurrentversions"></a>
Specifies how many noncurrent versions Amazon S3 will retain. If there are this many more recent noncurrent versions, Amazon S3 will take the associated action. For more information about noncurrent versions, see [Lifecycle configuration elements](https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html) in the *Amazon S3 User Guide*.  
*Required*: No  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`StorageClass`  <a name="cfn-s3-bucket-noncurrentversiontransition-storageclass"></a>
The class of storage used to store the object.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `DEEP_ARCHIVE | GLACIER | Glacier | GLACIER_IR | INTELLIGENT_TIERING | ONEZONE_IA | STANDARD_IA`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TransitionInDays`  <a name="cfn-s3-bucket-noncurrentversiontransition-transitionindays"></a>
Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. For information about the noncurrent days calculations, see [How Amazon S3 Calculates How Long an Object Has Been Noncurrent](https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations) in the *Amazon S3 User Guide*.  
*Required*: Yes  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket NotificationConfiguration
<a name="aws-properties-s3-bucket-notificationconfiguration"></a>

Describes the notification configuration for an Amazon S3 bucket.

**Note**  
If you create the target resource and related permissions in the same template, you might have a circular dependency.  
For example, you might use the `AWS::Lambda::Permission` resource to grant the bucket permission to invoke an AWS Lambda function. However, AWS CloudFormation can't create the bucket until the bucket has permission to invoke the function (AWS CloudFormation checks whether the bucket can invoke the function). If you're using Refs to pass the bucket name, this leads to a circular dependency.  
To avoid this dependency, you can create all resources without specifying the notification configuration. Then, update the stack with a notification configuration.  
For more information on permissions, see [AWS::Lambda::Permission](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html) and [Granting Permissions to Publish Event Notification Messages to a Destination](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html#grant-destinations-permissions-to-s3).

## Syntax
<a name="aws-properties-s3-bucket-notificationconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-notificationconfiguration-syntax.json"></a>

```
{
  "[EventBridgeConfiguration](#cfn-s3-bucket-notificationconfiguration-eventbridgeconfiguration)" : EventBridgeConfiguration,
  "[LambdaConfigurations](#cfn-s3-bucket-notificationconfiguration-lambdaconfigurations)" : [ LambdaConfiguration, ... ],
  "[QueueConfigurations](#cfn-s3-bucket-notificationconfiguration-queueconfigurations)" : [ QueueConfiguration, ... ],
  "[TopicConfigurations](#cfn-s3-bucket-notificationconfiguration-topicconfigurations)" : [ TopicConfiguration, ... ]
}
```

### YAML
<a name="aws-properties-s3-bucket-notificationconfiguration-syntax.yaml"></a>

```
  [EventBridgeConfiguration](#cfn-s3-bucket-notificationconfiguration-eventbridgeconfiguration): 
    EventBridgeConfiguration
  [LambdaConfigurations](#cfn-s3-bucket-notificationconfiguration-lambdaconfigurations): 
    - LambdaConfiguration
  [QueueConfigurations](#cfn-s3-bucket-notificationconfiguration-queueconfigurations): 
    - QueueConfiguration
  [TopicConfigurations](#cfn-s3-bucket-notificationconfiguration-topicconfigurations): 
    - TopicConfiguration
```

## Properties
<a name="aws-properties-s3-bucket-notificationconfiguration-properties"></a>

`EventBridgeConfiguration`  <a name="cfn-s3-bucket-notificationconfiguration-eventbridgeconfiguration"></a>
Enables delivery of events to Amazon EventBridge.  
*Required*: No  
*Type*: [EventBridgeConfiguration](aws-properties-s3-bucket-eventbridgeconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`LambdaConfigurations`  <a name="cfn-s3-bucket-notificationconfiguration-lambdaconfigurations"></a>
Describes the AWS Lambda functions to invoke and the events for which to invoke them.  
*Required*: No  
*Type*: Array of [LambdaConfiguration](aws-properties-s3-bucket-lambdaconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`QueueConfigurations`  <a name="cfn-s3-bucket-notificationconfiguration-queueconfigurations"></a>
The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages.  
*Required*: No  
*Type*: Array of [QueueConfiguration](aws-properties-s3-bucket-queueconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TopicConfigurations`  <a name="cfn-s3-bucket-notificationconfiguration-topicconfigurations"></a>
The topic to which notifications are sent and the events for which notifications are generated.  
*Required*: No  
*Type*: Array of [TopicConfiguration](aws-properties-s3-bucket-topicconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-notificationconfiguration--examples"></a>



### Receive S3 bucket notifications to an SNS topic
<a name="aws-properties-s3-bucket-notificationconfiguration--examples--Receive_S3_bucket_notifications_to_an_SNS_topic"></a>

The following example template shows an Amazon S3 bucket with a notification configuration that sends an event to the specified SNS topic when S3 has lost all replicas of an object.

#### JSON
<a name="aws-properties-s3-bucket-notificationconfiguration--examples--Receive_S3_bucket_notifications_to_an_SNS_topic--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "AccessControl": "Private",
                "NotificationConfiguration": {
                    "TopicConfigurations": [
                        {
                            "Topic": "arn:aws:sns:us-east-1:123456789012:TestTopic",
                            "Event": "s3:ReducedRedundancyLostObject"
                        }
                    ]
                }
            }
        }
    },
    "Outputs": {
        "BucketName": {
            "Value": {
                "Ref": "S3Bucket"
            },
            "Description": "Name of the sample Amazon S3 bucket with a notification configuration."
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-notificationconfiguration--examples--Receive_S3_bucket_notifications_to_an_SNS_topic--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      AccessControl: Private
      NotificationConfiguration:
        TopicConfigurations:
          - Topic: 'arn:aws:sns:us-east-1:123456789012:TestTopic'
            Event: 's3:ReducedRedundancyLostObject'
Outputs:
  BucketName:
    Value: !Ref S3Bucket
    Description: Name of the sample Amazon S3 bucket with a notification configuration.
```

# AWS::S3::Bucket NotificationFilter
<a name="aws-properties-s3-bucket-notificationfilter"></a>

Specifies object key name filtering rules. For information about key name filtering, see [Configuring event notifications using object key name filtering](https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) in the *Amazon S3 User Guide*.

## Syntax
<a name="aws-properties-s3-bucket-notificationfilter-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-notificationfilter-syntax.json"></a>

```
{
  "[S3Key](#cfn-s3-bucket-notificationfilter-s3key)" : S3KeyFilter
}
```

### YAML
<a name="aws-properties-s3-bucket-notificationfilter-syntax.yaml"></a>

```
  [S3Key](#cfn-s3-bucket-notificationfilter-s3key): 
    S3KeyFilter
```

## Properties
<a name="aws-properties-s3-bucket-notificationfilter-properties"></a>

`S3Key`  <a name="cfn-s3-bucket-notificationfilter-s3key"></a>
A container for object key name prefix and suffix filtering rules.  
*Required*: Yes  
*Type*: [S3KeyFilter](aws-properties-s3-bucket-s3keyfilter.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket ObjectLockConfiguration
<a name="aws-properties-s3-bucket-objectlockconfiguration"></a>

Places an Object Lock configuration on the specified bucket. The rule specified in the Object Lock configuration will be applied by default to every new object placed in the specified bucket. For more information, see [Locking Objects](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). 

## Syntax
<a name="aws-properties-s3-bucket-objectlockconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-objectlockconfiguration-syntax.json"></a>

```
{
  "[ObjectLockEnabled](#cfn-s3-bucket-objectlockconfiguration-objectlockenabled)" : String,
  "[Rule](#cfn-s3-bucket-objectlockconfiguration-rule)" : ObjectLockRule
}
```

### YAML
<a name="aws-properties-s3-bucket-objectlockconfiguration-syntax.yaml"></a>

```
  [ObjectLockEnabled](#cfn-s3-bucket-objectlockconfiguration-objectlockenabled): String
  [Rule](#cfn-s3-bucket-objectlockconfiguration-rule): 
    ObjectLockRule
```

## Properties
<a name="aws-properties-s3-bucket-objectlockconfiguration-properties"></a>

`ObjectLockEnabled`  <a name="cfn-s3-bucket-objectlockconfiguration-objectlockenabled"></a>
Indicates whether this bucket has an Object Lock configuration enabled. Enable `ObjectLockEnabled` when you apply `ObjectLockConfiguration` to a bucket.   
*Required*: No  
*Type*: String  
*Allowed values*: `Enabled`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Rule`  <a name="cfn-s3-bucket-objectlockconfiguration-rule"></a>
Specifies the Object Lock rule for the specified object. Enable this rule when you apply `ObjectLockConfiguration` to a bucket. If Object Lock is turned on, bucket settings require both `Mode` and a period of either `Days` or `Years`. You cannot specify `Days` and `Years` at the same time. For more information, see [ObjectLockRule](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-objectlockrule.html) and [DefaultRetention](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-defaultretention.html).  
*Required*: Conditional  
*Type*: [ObjectLockRule](aws-properties-s3-bucket-objectlockrule.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## See also
<a name="aws-properties-s3-bucket-objectlockconfiguration--seealso"></a>
+ AWS::S3::Bucket [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#aws-properties-s3-bucket--examples)



# AWS::S3::Bucket ObjectLockRule
<a name="aws-properties-s3-bucket-objectlockrule"></a>

Specifies the Object Lock rule for the specified object. Enable the this rule when you apply `ObjectLockConfiguration` to a bucket.

## Syntax
<a name="aws-properties-s3-bucket-objectlockrule-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-objectlockrule-syntax.json"></a>

```
{
  "[DefaultRetention](#cfn-s3-bucket-objectlockrule-defaultretention)" : DefaultRetention
}
```

### YAML
<a name="aws-properties-s3-bucket-objectlockrule-syntax.yaml"></a>

```
  [DefaultRetention](#cfn-s3-bucket-objectlockrule-defaultretention): 
    DefaultRetention
```

## Properties
<a name="aws-properties-s3-bucket-objectlockrule-properties"></a>

`DefaultRetention`  <a name="cfn-s3-bucket-objectlockrule-defaultretention"></a>
The default Object Lock retention mode and period that you want to apply to new objects placed in the specified bucket. If Object Lock is turned on, bucket settings require both `Mode` and a period of either `Days` or `Years`. You cannot specify `Days` and `Years` at the same time. For more information about allowable values for mode and period, see [DefaultRetention](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-defaultretention.html).  
*Required*: Conditional  
*Type*: [DefaultRetention](aws-properties-s3-bucket-defaultretention.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket OwnershipControls
<a name="aws-properties-s3-bucket-ownershipcontrols"></a>

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](https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) in the *Amazon S3 User Guide*. 

## Syntax
<a name="aws-properties-s3-bucket-ownershipcontrols-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-ownershipcontrols-syntax.json"></a>

```
{
  "[Rules](#cfn-s3-bucket-ownershipcontrols-rules)" : [ OwnershipControlsRule, ... ]
}
```

### YAML
<a name="aws-properties-s3-bucket-ownershipcontrols-syntax.yaml"></a>

```
  [Rules](#cfn-s3-bucket-ownershipcontrols-rules): 
    - OwnershipControlsRule
```

## Properties
<a name="aws-properties-s3-bucket-ownershipcontrols-properties"></a>

`Rules`  <a name="cfn-s3-bucket-ownershipcontrols-rules"></a>
Specifies the container element for Object Ownership rules.  
*Required*: Yes  
*Type*: Array of [OwnershipControlsRule](aws-properties-s3-bucket-ownershipcontrolsrule.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-ownershipcontrols--examples"></a>



**Topics**
+ [Object ownership - BucketOwnerEnforced](#aws-properties-s3-bucket-ownershipcontrols--examples--Object_ownership_-_BucketOwnerEnforced)
+ [Object Ownership - BucketOwnerPreferred](#aws-properties-s3-bucket-ownershipcontrols--examples--Object_Ownership_-_BucketOwnerPreferred)

### Object ownership - BucketOwnerEnforced
<a name="aws-properties-s3-bucket-ownershipcontrols--examples--Object_ownership_-_BucketOwnerEnforced"></a>

The following examples show Object Ownership set to `BucketOwnerEnforced`.

#### JSON
<a name="aws-properties-s3-bucket-ownershipcontrols--examples--Object_ownership_-_BucketOwnerEnforced--json"></a>

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

#### YAML
<a name="aws-properties-s3-bucket-ownershipcontrols--examples--Object_ownership_-_BucketOwnerEnforced--yaml"></a>

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

### Object Ownership - BucketOwnerPreferred
<a name="aws-properties-s3-bucket-ownershipcontrols--examples--Object_Ownership_-_BucketOwnerPreferred"></a>

The following examples show Object Ownership set to `BucketOwnerPreferred`.

#### JSON
<a name="aws-properties-s3-bucket-ownershipcontrols--examples--Object_Ownership_-_BucketOwnerPreferred--json"></a>

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

#### YAML
<a name="aws-properties-s3-bucket-ownershipcontrols--examples--Object_Ownership_-_BucketOwnerPreferred--yaml"></a>

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

# AWS::S3::Bucket OwnershipControlsRule
<a name="aws-properties-s3-bucket-ownershipcontrolsrule"></a>

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](https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) in the *Amazon S3 User Guide*. 

## Syntax
<a name="aws-properties-s3-bucket-ownershipcontrolsrule-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-ownershipcontrolsrule-syntax.json"></a>

```
{
  "[ObjectOwnership](#cfn-s3-bucket-ownershipcontrolsrule-objectownership)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-ownershipcontrolsrule-syntax.yaml"></a>

```
  [ObjectOwnership](#cfn-s3-bucket-ownershipcontrolsrule-objectownership): String
```

## Properties
<a name="aws-properties-s3-bucket-ownershipcontrolsrule-properties"></a>

`ObjectOwnership`  <a name="cfn-s3-bucket-ownershipcontrolsrule-objectownership"></a>
Specifies an object ownership rule.  
*Required*: No  
*Type*: String  
*Allowed values*: `ObjectWriter | BucketOwnerPreferred | BucketOwnerEnforced`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-ownershipcontrolsrule--examples"></a>



**Topics**
+ [Object Ownership - BucketOwnerEnforced](#aws-properties-s3-bucket-ownershipcontrolsrule--examples--Object_Ownership_-_BucketOwnerEnforced)
+ [Object Ownership - BucketOwnerPreferred](#aws-properties-s3-bucket-ownershipcontrolsrule--examples--Object_Ownership_-_BucketOwnerPreferred)

### Object Ownership - BucketOwnerEnforced
<a name="aws-properties-s3-bucket-ownershipcontrolsrule--examples--Object_Ownership_-_BucketOwnerEnforced"></a>

The following examples show Object Ownership set to `BucketOwnerEnforced`.

#### JSON
<a name="aws-properties-s3-bucket-ownershipcontrolsrule--examples--Object_Ownership_-_BucketOwnerEnforced--json"></a>

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

#### YAML
<a name="aws-properties-s3-bucket-ownershipcontrolsrule--examples--Object_Ownership_-_BucketOwnerEnforced--yaml"></a>

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

### Object Ownership - BucketOwnerPreferred
<a name="aws-properties-s3-bucket-ownershipcontrolsrule--examples--Object_Ownership_-_BucketOwnerPreferred"></a>

The following examples show Object Ownership set to `BucketOwnerPreferred`.

#### JSON
<a name="aws-properties-s3-bucket-ownershipcontrolsrule--examples--Object_Ownership_-_BucketOwnerPreferred--json"></a>

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

#### YAML
<a name="aws-properties-s3-bucket-ownershipcontrolsrule--examples--Object_Ownership_-_BucketOwnerPreferred--yaml"></a>

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

# AWS::S3::Bucket PartitionedPrefix
<a name="aws-properties-s3-bucket-partitionedprefix"></a>

Amazon S3 keys for log objects are partitioned in the following format:

 `[DestinationPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]` 

PartitionedPrefix defaults to EventTime delivery when server access logs are delivered.

## Syntax
<a name="aws-properties-s3-bucket-partitionedprefix-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-partitionedprefix-syntax.json"></a>

```
{
  "[PartitionDateSource](#cfn-s3-bucket-partitionedprefix-partitiondatesource)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-partitionedprefix-syntax.yaml"></a>

```
  [PartitionDateSource](#cfn-s3-bucket-partitionedprefix-partitiondatesource): String
```

## Properties
<a name="aws-properties-s3-bucket-partitionedprefix-properties"></a>

`PartitionDateSource`  <a name="cfn-s3-bucket-partitionedprefix-partitiondatesource"></a>
Specifies the partition date source for the partitioned prefix. `PartitionDateSource` can be `EventTime` or `DeliveryTime`.  
For `DeliveryTime`, the time in the log file names corresponds to the delivery time for the log files.   
 For `EventTime`, The logs delivered are for a specific day only. The year, month, and day correspond to the day on which the event occurred, and the hour, minutes and seconds are set to 00 in the key.  
*Required*: No  
*Type*: String  
*Allowed values*: `EventTime | DeliveryTime`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket PublicAccessBlockConfiguration
<a name="aws-properties-s3-bucket-publicaccessblockconfiguration"></a>

The PublicAccessBlock configuration that you want to apply to this Amazon S3 bucket. You can enable the configuration options in any combination. Bucket-level settings work alongside account-level settings (which may inherit from organization-level policies). For more information about when Amazon S3 considers a bucket or object public, see [The Meaning of "Public"](https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status) in the *Amazon S3 User Guide*. 

## Syntax
<a name="aws-properties-s3-bucket-publicaccessblockconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-publicaccessblockconfiguration-syntax.json"></a>

```
{
  "[BlockPublicAcls](#cfn-s3-bucket-publicaccessblockconfiguration-blockpublicacls)" : Boolean,
  "[BlockPublicPolicy](#cfn-s3-bucket-publicaccessblockconfiguration-blockpublicpolicy)" : Boolean,
  "[IgnorePublicAcls](#cfn-s3-bucket-publicaccessblockconfiguration-ignorepublicacls)" : Boolean,
  "[RestrictPublicBuckets](#cfn-s3-bucket-publicaccessblockconfiguration-restrictpublicbuckets)" : Boolean
}
```

### YAML
<a name="aws-properties-s3-bucket-publicaccessblockconfiguration-syntax.yaml"></a>

```
  [BlockPublicAcls](#cfn-s3-bucket-publicaccessblockconfiguration-blockpublicacls): Boolean
  [BlockPublicPolicy](#cfn-s3-bucket-publicaccessblockconfiguration-blockpublicpolicy): Boolean
  [IgnorePublicAcls](#cfn-s3-bucket-publicaccessblockconfiguration-ignorepublicacls): Boolean
  [RestrictPublicBuckets](#cfn-s3-bucket-publicaccessblockconfiguration-restrictpublicbuckets): Boolean
```

## Properties
<a name="aws-properties-s3-bucket-publicaccessblockconfiguration-properties"></a>

`BlockPublicAcls`  <a name="cfn-s3-bucket-publicaccessblockconfiguration-blockpublicacls"></a>
Specifies whether Amazon S3 should block public access control lists (ACLs) for this bucket and objects in this bucket. Setting this element to `TRUE` causes the following behavior:  
+ PUT Bucket ACL and PUT Object ACL calls fail if the specified ACL is public.
+ PUT Object calls fail if the request includes a public ACL.
+ PUT Bucket calls fail if the request includes a public ACL.
Enabling this setting doesn't affect existing policies or ACLs.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`BlockPublicPolicy`  <a name="cfn-s3-bucket-publicaccessblockconfiguration-blockpublicpolicy"></a>
Specifies whether Amazon S3 should block public bucket policies for this bucket. Setting this element to `TRUE` causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access.   
Enabling this setting doesn't affect existing bucket policies.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`IgnorePublicAcls`  <a name="cfn-s3-bucket-publicaccessblockconfiguration-ignorepublicacls"></a>
Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket. Setting this element to `TRUE` causes Amazon S3 to ignore all public ACLs on this bucket and objects in this bucket.  
Enabling this setting doesn't affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RestrictPublicBuckets`  <a name="cfn-s3-bucket-publicaccessblockconfiguration-restrictpublicbuckets"></a>
Specifies whether Amazon S3 should restrict public bucket policies for this bucket. Setting this element to `TRUE` restricts access to this bucket to only AWS service principals and authorized users within this account if the bucket has a public policy.  
Enabling this setting doesn't affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non-public delegation to specific accounts, is blocked.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## See also
<a name="aws-properties-s3-bucket-publicaccessblockconfiguration--seealso"></a>
+ AWS::S3::Bucket [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#aws-properties-s3-bucket--examples)



# AWS::S3::Bucket QueueConfiguration
<a name="aws-properties-s3-bucket-queueconfiguration"></a>

Specifies the configuration for publishing messages to an Amazon Simple Queue Service (Amazon SQS) queue when Amazon S3 detects specified events.

## Syntax
<a name="aws-properties-s3-bucket-queueconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-queueconfiguration-syntax.json"></a>

```
{
  "[Event](#cfn-s3-bucket-queueconfiguration-event)" : String,
  "[Filter](#cfn-s3-bucket-queueconfiguration-filter)" : NotificationFilter,
  "[Queue](#cfn-s3-bucket-queueconfiguration-queue)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-queueconfiguration-syntax.yaml"></a>

```
  [Event](#cfn-s3-bucket-queueconfiguration-event): String
  [Filter](#cfn-s3-bucket-queueconfiguration-filter): 
    NotificationFilter
  [Queue](#cfn-s3-bucket-queueconfiguration-queue): String
```

## Properties
<a name="aws-properties-s3-bucket-queueconfiguration-properties"></a>

`Event`  <a name="cfn-s3-bucket-queueconfiguration-event"></a>
The Amazon S3 bucket event about which you want to publish messages to Amazon SQS. For more information, see [Supported Event Types](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) in the *Amazon S3 User Guide*.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Filter`  <a name="cfn-s3-bucket-queueconfiguration-filter"></a>
 The filtering rules that determine which objects trigger notifications. For example, you can create a filter so that Amazon S3 sends notifications only when image files with a `.jpg` extension are added to the bucket. For more information, see [Configuring event notifications using object key name filtering](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/notification-how-to-filtering.html) in the *Amazon S3 User Guide*.   
*Required*: No  
*Type*: [NotificationFilter](aws-properties-s3-bucket-notificationfilter.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Queue`  <a name="cfn-s3-bucket-queueconfiguration-queue"></a>
The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 publishes a message when it detects events of the specified type. FIFO queues are not allowed when enabling an SQS queue as the event notification destination.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket RecordExpiration
<a name="aws-properties-s3-bucket-recordexpiration"></a>

 The journal table record expiration settings for a journal table in an S3 Metadata configuration. 

## Syntax
<a name="aws-properties-s3-bucket-recordexpiration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-recordexpiration-syntax.json"></a>

```
{
  "[Days](#cfn-s3-bucket-recordexpiration-days)" : Integer,
  "[Expiration](#cfn-s3-bucket-recordexpiration-expiration)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-recordexpiration-syntax.yaml"></a>

```
  [Days](#cfn-s3-bucket-recordexpiration-days): Integer
  [Expiration](#cfn-s3-bucket-recordexpiration-expiration): String
```

## Properties
<a name="aws-properties-s3-bucket-recordexpiration-properties"></a>

`Days`  <a name="cfn-s3-bucket-recordexpiration-days"></a>
 If you enable journal table record expiration, you can set the number of days to retain your journal table records. Journal table records must be retained for a minimum of 7 days. To set this value, specify any whole number from `7` to `2147483647`. For example, to retain your journal table records for one year, set this value to `365`.   
*Required*: No  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Expiration`  <a name="cfn-s3-bucket-recordexpiration-expiration"></a>
 Specifies whether journal table record expiration is enabled or disabled.   
*Required*: Yes  
*Type*: String  
*Allowed values*: `ENABLED | DISABLED`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket RedirectAllRequestsTo
<a name="aws-properties-s3-bucket-redirectallrequeststo"></a>

Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket.

## Syntax
<a name="aws-properties-s3-bucket-redirectallrequeststo-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-redirectallrequeststo-syntax.json"></a>

```
{
  "[HostName](#cfn-s3-bucket-redirectallrequeststo-hostname)" : String,
  "[Protocol](#cfn-s3-bucket-redirectallrequeststo-protocol)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-redirectallrequeststo-syntax.yaml"></a>

```
  [HostName](#cfn-s3-bucket-redirectallrequeststo-hostname): String
  [Protocol](#cfn-s3-bucket-redirectallrequeststo-protocol): String
```

## Properties
<a name="aws-properties-s3-bucket-redirectallrequeststo-properties"></a>

`HostName`  <a name="cfn-s3-bucket-redirectallrequeststo-hostname"></a>
Name of the host where requests are redirected.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Protocol`  <a name="cfn-s3-bucket-redirectallrequeststo-protocol"></a>
Protocol to use when redirecting requests. The default is the protocol that is used in the original request.  
*Required*: No  
*Type*: String  
*Allowed values*: `http | https`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket RedirectRule
<a name="aws-properties-s3-bucket-redirectrule"></a>

Specifies how requests are redirected. In the event of an error, you can specify a different error code to return.

## Syntax
<a name="aws-properties-s3-bucket-redirectrule-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-redirectrule-syntax.json"></a>

```
{
  "[HostName](#cfn-s3-bucket-redirectrule-hostname)" : String,
  "[HttpRedirectCode](#cfn-s3-bucket-redirectrule-httpredirectcode)" : String,
  "[Protocol](#cfn-s3-bucket-redirectrule-protocol)" : String,
  "[ReplaceKeyPrefixWith](#cfn-s3-bucket-redirectrule-replacekeyprefixwith)" : String,
  "[ReplaceKeyWith](#cfn-s3-bucket-redirectrule-replacekeywith)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-redirectrule-syntax.yaml"></a>

```
  [HostName](#cfn-s3-bucket-redirectrule-hostname): String
  [HttpRedirectCode](#cfn-s3-bucket-redirectrule-httpredirectcode): String
  [Protocol](#cfn-s3-bucket-redirectrule-protocol): String
  [ReplaceKeyPrefixWith](#cfn-s3-bucket-redirectrule-replacekeyprefixwith): String
  [ReplaceKeyWith](#cfn-s3-bucket-redirectrule-replacekeywith): String
```

## Properties
<a name="aws-properties-s3-bucket-redirectrule-properties"></a>

`HostName`  <a name="cfn-s3-bucket-redirectrule-hostname"></a>
The host name to use in the redirect request.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`HttpRedirectCode`  <a name="cfn-s3-bucket-redirectrule-httpredirectcode"></a>
The HTTP redirect code to use on the response. Not required if one of the siblings is present.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Protocol`  <a name="cfn-s3-bucket-redirectrule-protocol"></a>
Protocol to use when redirecting requests. The default is the protocol that is used in the original request.  
*Required*: No  
*Type*: String  
*Allowed values*: `http | https`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ReplaceKeyPrefixWith`  <a name="cfn-s3-bucket-redirectrule-replacekeyprefixwith"></a>
The object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix `docs/` (objects in the `docs/` folder) to `documents/`, you can set a condition block with `KeyPrefixEquals` set to `docs/` and in the Redirect set `ReplaceKeyPrefixWith` to `/documents`. Not required if one of the siblings is present. Can be present only if `ReplaceKeyWith` is not provided.  
Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see [ XML related object key constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints).
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ReplaceKeyWith`  <a name="cfn-s3-bucket-redirectrule-replacekeywith"></a>
The specific object key to use in the redirect request. For example, redirect request to `error.html`. Not required if one of the siblings is present. Can be present only if `ReplaceKeyPrefixWith` is not provided.  
Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see [ XML related object key constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints).
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-redirectrule--examples"></a>



### Configure a static website with a routing rule
<a name="aws-properties-s3-bucket-redirectrule--examples--Configure_a_static_website_with_a_routing_rule"></a>

In this example, `AWS::S3::Bucket's Fn::GetAtt` values are used to provide outputs. If an HTTP 404 error occurs, the routing rule redirects requests to an EC2 instance and inserts the object key prefix `report-404/` in the redirect. For example, if you request a page called `out1/ExamplePage.html` and it results in an HTTP 404 error, the request is routed to a page called `report-404/ExamplePage.html` on the specified instance. For all other HTTP error codes, `error.html` is returned. 

This example also specifies a metrics configuration called `EntireBucket` that enables CloudWatch request metrics at the bucket level.

#### JSON
<a name="aws-properties-s3-bucket-redirectrule--examples--Configure_a_static_website_with_a_routing_rule--json"></a>

```
{
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "AccessControl": "PublicRead",
                "BucketName": "public-bucket",
                "MetricsConfigurations": [
                    {
                        "Id": "EntireBucket"
                    }
                ],
                "WebsiteConfiguration": {
                    "IndexDocument": "index.html",
                    "ErrorDocument": "error.html",
                    "RoutingRules": [
                        {
                            "RoutingRuleCondition": {
                                "HttpErrorCodeReturnedEquals": "404",
                                "KeyPrefixEquals": "out1/"
                            },
                            "RedirectRule": {
                                "HostName": "ec2-11-22-333-44.compute-1.amazonaws.com",
                                "ReplaceKeyPrefixWith": "report-404/"
                            }
                        }
                    ]
                }
            },
            "DeletionPolicy": "Retain"
        }
    },
    "Outputs": {
        "WebsiteURL": {
            "Value": {
                "Fn::GetAtt": [
                    "S3Bucket",
                    "WebsiteURL"
                ]
            },
            "Description": "URL for website hosted on S3"
        },
        "S3BucketSecureURL": {
            "Value": {
                "Fn::Join": [
                    "",
                    [
                        "https://",
                        {
                            "Fn::GetAtt": [
                                "S3Bucket",
                                "DomainName"
                            ]
                        }
                    ]
                ]
            },
            "Description": "Name of S3 bucket to hold website content"
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-redirectrule--examples--Configure_a_static_website_with_a_routing_rule--yaml"></a>

```
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      AccessControl: PublicRead
      BucketName: public-bucket
      MetricsConfigurations:
        - Id: EntireBucket
      WebsiteConfiguration:
        IndexDocument: index.html
        ErrorDocument: error.html
        RoutingRules:
          - RoutingRuleCondition:
              HttpErrorCodeReturnedEquals: '404'
              KeyPrefixEquals: out1/
            RedirectRule:
              HostName: ec2-11-22-333-44.compute-1.amazonaws.com
              ReplaceKeyPrefixWith: report-404/
    DeletionPolicy: Retain
Outputs:
  WebsiteURL:
    Value: !GetAtt
      - S3Bucket
      - WebsiteURL
    Description: URL for website hosted on S3
  S3BucketSecureURL:
    Value: !Join
      - ''
      - - 'https://'
        - !GetAtt
          - S3Bucket
          - DomainName
    Description: Name of S3 bucket to hold website content
```

# AWS::S3::Bucket ReplicaModifications
<a name="aws-properties-s3-bucket-replicamodifications"></a>

A filter that you can specify for selection for modifications on replicas. 

## Syntax
<a name="aws-properties-s3-bucket-replicamodifications-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-replicamodifications-syntax.json"></a>

```
{
  "[Status](#cfn-s3-bucket-replicamodifications-status)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-replicamodifications-syntax.yaml"></a>

```
  [Status](#cfn-s3-bucket-replicamodifications-status): String
```

## Properties
<a name="aws-properties-s3-bucket-replicamodifications-properties"></a>

`Status`  <a name="cfn-s3-bucket-replicamodifications-status"></a>
Specifies whether Amazon S3 replicates modifications on replicas.  
*Allowed values*: `Enabled` \$1 `Disabled`  
*Required*: Yes  
*Type*: String  
*Allowed values*: `Enabled | Disabled`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket ReplicationConfiguration
<a name="aws-properties-s3-bucket-replicationconfiguration"></a>

A container for replication rules. You can add up to 1,000 rules. The maximum size of a replication configuration is 2 MB. The latest version of the replication configuration XML is V2. For more information about XML V2 replication configurations, see [Replication configuration](https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication-add-config.html) in the *Amazon S3 User Guide*.

## Syntax
<a name="aws-properties-s3-bucket-replicationconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-replicationconfiguration-syntax.json"></a>

```
{
  "[Role](#cfn-s3-bucket-replicationconfiguration-role)" : String,
  "[Rules](#cfn-s3-bucket-replicationconfiguration-rules)" : [ ReplicationRule, ... ]
}
```

### YAML
<a name="aws-properties-s3-bucket-replicationconfiguration-syntax.yaml"></a>

```
  [Role](#cfn-s3-bucket-replicationconfiguration-role): String
  [Rules](#cfn-s3-bucket-replicationconfiguration-rules): 
    - ReplicationRule
```

## Properties
<a name="aws-properties-s3-bucket-replicationconfiguration-properties"></a>

`Role`  <a name="cfn-s3-bucket-replicationconfiguration-role"></a>
The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that Amazon S3 assumes when replicating objects. For more information, see [How to Set Up Replication](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-how-setup.html) in the *Amazon S3 User Guide*.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Rules`  <a name="cfn-s3-bucket-replicationconfiguration-rules"></a>
A container for one or more replication rules. A replication configuration must have at least one rule and can contain a maximum of 1,000 rules.   
*Required*: Yes  
*Type*: Array of [ReplicationRule](aws-properties-s3-bucket-replicationrule.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-replicationconfiguration--examples"></a>



**Topics**
+ [Associate a replication configuration IAM role with an S3 bucket](#aws-properties-s3-bucket-replicationconfiguration--examples--Associate_a_replication_configuration_IAM_role_with_an_S3_bucket)
+ [Enable versioning and replicate objects](#aws-properties-s3-bucket-replicationconfiguration--examples--Enable_versioning_and_replicate_objects)

### Associate a replication configuration IAM role with an S3 bucket
<a name="aws-properties-s3-bucket-replicationconfiguration--examples--Associate_a_replication_configuration_IAM_role_with_an_S3_bucket"></a>

The following example creates an S3 bucket and grants it permission to write to a replication bucket by using an AWS Identity and Access Management (IAM) role. To avoid a circular dependency, the role's policy is declared as a separate resource. The bucket depends on the `WorkItemBucketBackupRole` role. If the policy is included in the role, the role also depends on the bucket.

#### JSON
<a name="aws-properties-s3-bucket-replicationconfiguration--examples--Associate_a_replication_configuration_IAM_role_with_an_S3_bucket--json"></a>

```
{
    "Resources": {
        "RecordServiceS3Bucket": {
            "Type": "AWS::S3::Bucket",
            "DeletionPolicy": "Retain",
            "Properties": {
                "ReplicationConfiguration": {
                    "Role": {
                        "Fn::GetAtt": [
                            "WorkItemBucketBackupRole",
                            "Arn"
                        ]
                    },
                    "Rules": [
                        {
                            "Destination": {
                                "Bucket": {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "arn:aws:s3:::",
                                            {
                                                "Fn::Join": [
                                                    "-",
                                                    [
                                                        {
                                                            "Ref": "AWS::Region"
                                                        },
                                                        {
                                                            "Ref": "AWS::StackName"
                                                        },
                                                        "replicationbucket"
                                                    ]
                                                ]
                                            }
                                        ]
                                    ]
                                },
                                "StorageClass": "STANDARD"
                            },
                            "Id": "Backup",
                            "Prefix": "",
                            "Status": "Enabled"
                        }
                    ]
                },
                "VersioningConfiguration": {
                    "Status": "Enabled"
                }
            }
        },
        "WorkItemBucketBackupRole": {
            "Type": "AWS::IAM::Role",
            "Properties": {
                "AssumeRolePolicyDocument": {
                    "Statement": [
                        {
                            "Action": [
                                "sts:AssumeRole"
                            ],
                            "Effect": "Allow",
                            "Principal": {
                                "Service": [
                                    "s3.amazonaws.com"
                                ]
                            }
                        }
                    ]
                }
            }
        },
        "BucketBackupPolicy": {
            "Type": "AWS::IAM::Policy",
            "Properties": {
                "PolicyDocument": {
                    "Statement": [
                        {
                            "Action": [
                                "s3:GetReplicationConfiguration",
                                "s3:ListBucket"
                            ],
                            "Effect": "Allow",
                            "Resource": [
                                {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "arn:aws:s3:::",
                                            {
                                                "Ref": "RecordServiceS3Bucket"
                                            }
                                        ]
                                    ]
                                }
                            ]
                        },
                        {
                            "Action": [
                                "s3:GetObjectVersion",
                                "s3:GetObjectVersionAcl"
                            ],
                            "Effect": "Allow",
                            "Resource": [
                                {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "arn:aws:s3:::",
                                            {
                                                "Ref": "RecordServiceS3Bucket"
                                            },
                                            "/*"
                                        ]
                                    ]
                                }
                            ]
                        },
                        {
                            "Action": [
                                "s3:ReplicateObject",
                                "s3:ReplicateDelete"
                            ],
                            "Effect": "Allow",
                            "Resource": [
                                {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "arn:aws:s3:::",
                                            {
                                                "Fn::Join": [
                                                    "-",
                                                    [
                                                        {
                                                            "Ref": "AWS::Region"
                                                        },
                                                        {
                                                            "Ref": "AWS::StackName"
                                                        },
                                                        "replicationbucket"
                                                    ]
                                                ]
                                            },
                                            "/*"
                                        ]
                                    ]
                                }
                            ]
                        }
                    ]
                },
                "PolicyName": "BucketBackupPolicy",
                "Roles": [
                    {
                        "Ref": "WorkItemBucketBackupRole"
                    }
                ]
            }
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-replicationconfiguration--examples--Associate_a_replication_configuration_IAM_role_with_an_S3_bucket--yaml"></a>

```
Resources:
  RecordServiceS3Bucket:
    Type: 'AWS::S3::Bucket'
    DeletionPolicy: Retain
    Properties:
      ReplicationConfiguration:
        Role: !GetAtt
          - WorkItemBucketBackupRole
          - Arn
        Rules:
          - Destination:
              Bucket: !Join
                - ''
                - - 'arn:aws:s3:::'
                  - !Join
                    - '-'
                    - - !Ref 'AWS::Region'
                      - !Ref 'AWS::StackName'
                      - replicationbucket
              StorageClass: STANDARD
            Id: Backup
            Prefix: ''
            Status: Enabled
      VersioningConfiguration:
        Status: Enabled
  WorkItemBucketBackupRole:
    Type: 'AWS::IAM::Role'
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Action:
              - 'sts:AssumeRole'
            Effect: Allow
            Principal:
              Service:
                - s3.amazonaws.com
  BucketBackupPolicy:
    Type: 'AWS::IAM::Policy'
    Properties:
      PolicyDocument:
        Statement:
          - Action:
              - 's3:GetReplicationConfiguration'
              - 's3:ListBucket'
            Effect: Allow
            Resource:
              - !Join
                - ''
                - - 'arn:aws:s3:::'
                  - !Ref RecordServiceS3Bucket
          - Action:
              - 's3:GetObjectVersion'
              - 's3:GetObjectVersionAcl'
            Effect: Allow
            Resource:
              - !Join
                - ''
                - - 'arn:aws:s3:::'
                  - !Ref RecordServiceS3Bucket
                  - /*
          - Action:
              - 's3:ReplicateObject'
              - 's3:ReplicateDelete'
            Effect: Allow
            Resource:
              - !Join
                - ''
                - - 'arn:aws:s3:::'
                  - !Join
                    - '-'
                    - - !Ref 'AWS::Region'
                      - !Ref 'AWS::StackName'
                      - replicationbucket
                  - /*
      PolicyName: BucketBackupPolicy
      Roles:
        - !Ref WorkItemBucketBackupRole
```

### Enable versioning and replicate objects
<a name="aws-properties-s3-bucket-replicationconfiguration--examples--Enable_versioning_and_replicate_objects"></a>

The following example enables versioning and two replication rules. The rules copy objects prefixed with either `MyPrefix` and `MyOtherPrefix` and stores the copied objects in a bucket named `my-replication-bucket`.

#### JSON
<a name="aws-properties-s3-bucket-replicationconfiguration--examples--Enable_versioning_and_replicate_objects--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "VersioningConfiguration": {
                    "Status": "Enabled"
                },
                "ReplicationConfiguration": {
                    "Role": "arn:aws:iam::123456789012:role/replication_role",
                    "Rules": [
                        {
                            "Id": "MyRule1",
                            "Status": "Enabled",
                            "Prefix": "MyPrefix",
                            "Destination": {
                                "Bucket": "arn:aws:s3:::my-replication-bucket",
                                "StorageClass": "STANDARD"
                            }
                        },
                        {
                            "Status": "Enabled",
                            "Prefix": "MyOtherPrefix",
                            "Destination": {
                                "Bucket": "arn:aws:s3:::my-replication-bucket"
                            }
                        }
                    ]
                }
            }
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-replicationconfiguration--examples--Enable_versioning_and_replicate_objects--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      VersioningConfiguration:
        Status: Enabled
      ReplicationConfiguration:
        Role: 'arn:aws:iam::123456789012:role/replication_role'
        Rules:
          - Id: MyRule1
            Status: Enabled
            Prefix: MyPrefix
            Destination:
              Bucket: 'arn:aws:s3:::my-replication-bucket'
              StorageClass: STANDARD
          - Status: Enabled
            Prefix: MyOtherPrefix
            Destination:
              Bucket: 'arn:aws:s3:::my-replication-bucket'
```

# AWS::S3::Bucket ReplicationDestination
<a name="aws-properties-s3-bucket-replicationdestination"></a>

A container for information about the replication destination and its configurations including enabling the S3 Replication Time Control (S3 RTC).

## Syntax
<a name="aws-properties-s3-bucket-replicationdestination-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-replicationdestination-syntax.json"></a>

```
{
  "[AccessControlTranslation](#cfn-s3-bucket-replicationdestination-accesscontroltranslation)" : AccessControlTranslation,
  "[Account](#cfn-s3-bucket-replicationdestination-account)" : String,
  "[Bucket](#cfn-s3-bucket-replicationdestination-bucket)" : String,
  "[EncryptionConfiguration](#cfn-s3-bucket-replicationdestination-encryptionconfiguration)" : EncryptionConfiguration,
  "[Metrics](#cfn-s3-bucket-replicationdestination-metrics)" : Metrics,
  "[ReplicationTime](#cfn-s3-bucket-replicationdestination-replicationtime)" : ReplicationTime,
  "[StorageClass](#cfn-s3-bucket-replicationdestination-storageclass)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-replicationdestination-syntax.yaml"></a>

```
  [AccessControlTranslation](#cfn-s3-bucket-replicationdestination-accesscontroltranslation): 
    AccessControlTranslation
  [Account](#cfn-s3-bucket-replicationdestination-account): String
  [Bucket](#cfn-s3-bucket-replicationdestination-bucket): String
  [EncryptionConfiguration](#cfn-s3-bucket-replicationdestination-encryptionconfiguration): 
    EncryptionConfiguration
  [Metrics](#cfn-s3-bucket-replicationdestination-metrics): 
    Metrics
  [ReplicationTime](#cfn-s3-bucket-replicationdestination-replicationtime): 
    ReplicationTime
  [StorageClass](#cfn-s3-bucket-replicationdestination-storageclass): String
```

## Properties
<a name="aws-properties-s3-bucket-replicationdestination-properties"></a>

`AccessControlTranslation`  <a name="cfn-s3-bucket-replicationdestination-accesscontroltranslation"></a>
Specify this only in a cross-account scenario (where source and destination bucket owners are not the same), and you want to change replica ownership to the AWS account that owns the destination bucket. If this is not specified in the replication configuration, the replicas are owned by same AWS account that owns the source object.  
*Required*: No  
*Type*: [AccessControlTranslation](aws-properties-s3-bucket-accesscontroltranslation.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Account`  <a name="cfn-s3-bucket-replicationdestination-account"></a>
Destination bucket owner account ID. In a cross-account scenario, if you direct Amazon S3 to change replica ownership to the AWS account that owns the destination bucket by specifying the `AccessControlTranslation` property, this is the account ID of the destination bucket owner. For more information, see [Cross-Region Replication Additional Configuration: Change Replica Owner](https://docs.aws.amazon.com/AmazonS3/latest/dev/crr-change-owner.html) in the *Amazon S3 User Guide*.  
If you specify the `AccessControlTranslation` property, the `Account` property is required.   
*Required*: Conditional  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Bucket`  <a name="cfn-s3-bucket-replicationdestination-bucket"></a>
 The Amazon Resource Name (ARN) of the bucket where you want Amazon S3 to store the results.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`EncryptionConfiguration`  <a name="cfn-s3-bucket-replicationdestination-encryptionconfiguration"></a>
Specifies encryption-related information.  
*Required*: No  
*Type*: [EncryptionConfiguration](aws-properties-s3-bucket-encryptionconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Metrics`  <a name="cfn-s3-bucket-replicationdestination-metrics"></a>
 A container specifying replication metrics-related settings enabling replication metrics and events.   
*Required*: No  
*Type*: [Metrics](aws-properties-s3-bucket-metrics.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ReplicationTime`  <a name="cfn-s3-bucket-replicationdestination-replicationtime"></a>
 A container specifying S3 Replication Time Control (S3 RTC), including whether S3 RTC is enabled and the time when all objects and operations on objects must be replicated. Must be specified together with a `Metrics` block.   
*Required*: No  
*Type*: [ReplicationTime](aws-properties-s3-bucket-replicationtime.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`StorageClass`  <a name="cfn-s3-bucket-replicationdestination-storageclass"></a>
 The storage class to use when replicating objects, such as S3 Standard or reduced redundancy. By default, Amazon S3 uses the storage class of the source object to create the object replica.   
For valid values, see the `StorageClass` element of the [PUT Bucket replication](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html) action in the *Amazon S3 API Reference*.  
`FSX_OPENZFS` is not an accepted value when replicating objects.  
*Required*: No  
*Type*: String  
*Allowed values*: `DEEP_ARCHIVE | GLACIER | GLACIER_IR | INTELLIGENT_TIERING | ONEZONE_IA | REDUCED_REDUNDANCY | STANDARD | STANDARD_IA`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket ReplicationRule
<a name="aws-properties-s3-bucket-replicationrule"></a>

Specifies which Amazon S3 objects to replicate and where to store the replicas.

## Syntax
<a name="aws-properties-s3-bucket-replicationrule-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-replicationrule-syntax.json"></a>

```
{
  "[DeleteMarkerReplication](#cfn-s3-bucket-replicationrule-deletemarkerreplication)" : DeleteMarkerReplication,
  "[Destination](#cfn-s3-bucket-replicationrule-destination)" : ReplicationDestination,
  "[Filter](#cfn-s3-bucket-replicationrule-filter)" : ReplicationRuleFilter,
  "[Id](#cfn-s3-bucket-replicationrule-id)" : String,
  "[Prefix](#cfn-s3-bucket-replicationrule-prefix)" : String,
  "[Priority](#cfn-s3-bucket-replicationrule-priority)" : Integer,
  "[SourceSelectionCriteria](#cfn-s3-bucket-replicationrule-sourceselectioncriteria)" : SourceSelectionCriteria,
  "[Status](#cfn-s3-bucket-replicationrule-status)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-replicationrule-syntax.yaml"></a>

```
  [DeleteMarkerReplication](#cfn-s3-bucket-replicationrule-deletemarkerreplication): 
    DeleteMarkerReplication
  [Destination](#cfn-s3-bucket-replicationrule-destination): 
    ReplicationDestination
  [Filter](#cfn-s3-bucket-replicationrule-filter): 
    ReplicationRuleFilter
  [Id](#cfn-s3-bucket-replicationrule-id): String
  [Prefix](#cfn-s3-bucket-replicationrule-prefix): String
  [Priority](#cfn-s3-bucket-replicationrule-priority): Integer
  [SourceSelectionCriteria](#cfn-s3-bucket-replicationrule-sourceselectioncriteria): 
    SourceSelectionCriteria
  [Status](#cfn-s3-bucket-replicationrule-status): String
```

## Properties
<a name="aws-properties-s3-bucket-replicationrule-properties"></a>

`DeleteMarkerReplication`  <a name="cfn-s3-bucket-replicationrule-deletemarkerreplication"></a>
Specifies whether Amazon S3 replicates delete markers. If you specify a `Filter` in your replication configuration, you must also include a `DeleteMarkerReplication` element. If your `Filter` includes a `Tag` element, the `DeleteMarkerReplication``Status` must be set to Disabled, because Amazon S3 does not support replicating delete markers for tag-based rules. For an example configuration, see [Basic Rule Configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-config-min-rule-config).   
For more information about delete marker replication, see [Basic Rule Configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html).   
If you are using an earlier version of the replication configuration, Amazon S3 handles replication of delete markers differently. For more information, see [Backward Compatibility](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations).
*Required*: No  
*Type*: [DeleteMarkerReplication](aws-properties-s3-bucket-deletemarkerreplication.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Destination`  <a name="cfn-s3-bucket-replicationrule-destination"></a>
A container for information about the replication destination and its configurations including enabling the S3 Replication Time Control (S3 RTC).  
*Required*: Yes  
*Type*: [ReplicationDestination](aws-properties-s3-bucket-replicationdestination.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Filter`  <a name="cfn-s3-bucket-replicationrule-filter"></a>
A filter that identifies the subset of objects to which the replication rule applies. A `Filter` must specify exactly one `Prefix`, `TagFilter`, or an `And` child element. The use of the filter field indicates that this is a V2 replication configuration. This field isn't supported in a V1 replication configuration.  
V1 replication configuration only supports filtering by key prefix. To filter using a V1 replication configuration, add the `Prefix` directly as a child element of the `Rule` element.
*Required*: No  
*Type*: [ReplicationRuleFilter](aws-properties-s3-bucket-replicationrulefilter.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Id`  <a name="cfn-s3-bucket-replicationrule-id"></a>
A unique identifier for the rule. The maximum value is 255 characters. If you don't specify a value, AWS CloudFormation generates a random ID. When using a V2 replication configuration this property is capitalized as "ID".  
*Required*: No  
*Type*: String  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Prefix`  <a name="cfn-s3-bucket-replicationrule-prefix"></a>
An object key name prefix that identifies the object or objects to which the rule applies. The maximum prefix length is 1,024 characters. To include all objects in a bucket, specify an empty string. To filter using a V1 replication configuration, add the `Prefix` directly as a child element of the `Rule` element.  
Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see [ XML related object key constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints).
*Required*: No  
*Type*: String  
*Maximum*: `1024`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Priority`  <a name="cfn-s3-bucket-replicationrule-priority"></a>
The priority indicates which rule has precedence whenever two or more replication rules conflict. Amazon S3 will attempt to replicate objects according to all replication rules. However, if there are two or more rules with the same destination bucket, then objects will be replicated according to the rule with the highest priority. The higher the number, the higher the priority.   
For more information, see [Replication](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) in the *Amazon S3 User Guide*.  
*Required*: No  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SourceSelectionCriteria`  <a name="cfn-s3-bucket-replicationrule-sourceselectioncriteria"></a>
A container that describes additional filters for identifying the source objects that you want to replicate. You can choose to enable or disable the replication of these objects.  
*Required*: No  
*Type*: [SourceSelectionCriteria](aws-properties-s3-bucket-sourceselectioncriteria.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Status`  <a name="cfn-s3-bucket-replicationrule-status"></a>
Specifies whether the rule is enabled.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `Disabled | Enabled`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-replicationrule--examples"></a>



**Topics**
+ [Associate a replication configuration IAM role with an S3 bucket](#aws-properties-s3-bucket-replicationrule--examples--Associate_a_replication_configuration_IAM_role_with_an_S3_bucket)
+ [Enable versioning and replicate objects](#aws-properties-s3-bucket-replicationrule--examples--Enable_versioning_and_replicate_objects)

### Associate a replication configuration IAM role with an S3 bucket
<a name="aws-properties-s3-bucket-replicationrule--examples--Associate_a_replication_configuration_IAM_role_with_an_S3_bucket"></a>

The following example creates an S3 bucket and grants it permission to write to a replication bucket by using an AWS Identity and Access Management (IAM) role. To avoid a circular dependency, the role's policy is declared as a separate resource. The bucket depends on the `WorkItemBucketBackupRole` role. If the policy is included in the role, the role also depends on the bucket.

#### JSON
<a name="aws-properties-s3-bucket-replicationrule--examples--Associate_a_replication_configuration_IAM_role_with_an_S3_bucket--json"></a>

```
{
    "Resources": {
        "RecordServiceS3Bucket": {
            "Type": "AWS::S3::Bucket",
            "DeletionPolicy": "Retain",
            "Properties": {
                "ReplicationConfiguration": {
                    "Role": {
                        "Fn::GetAtt": [
                            "WorkItemBucketBackupRole",
                            "Arn"
                        ]
                    },
                    "Rules": [
                        {
                            "Destination": {
                                "Bucket": {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "arn:aws:s3:::",
                                            {
                                                "Fn::Join": [
                                                    "-",
                                                    [
                                                        {
                                                            "Ref": "AWS::Region"
                                                        },
                                                        {
                                                            "Ref": "AWS::StackName"
                                                        },
                                                        "replicationbucket"
                                                    ]
                                                ]
                                            }
                                        ]
                                    ]
                                },
                                "StorageClass": "STANDARD"
                            },
                            "Id": "Backup",
                            "Prefix": "",
                            "Status": "Enabled"
                        }
                    ]
                },
                "VersioningConfiguration": {
                    "Status": "Enabled"
                }
            }
        },
        "WorkItemBucketBackupRole": {
            "Type": "AWS::IAM::Role",
            "Properties": {
                "AssumeRolePolicyDocument": {
                    "Statement": [
                        {
                            "Action": [
                                "sts:AssumeRole"
                            ],
                            "Effect": "Allow",
                            "Principal": {
                                "Service": [
                                    "s3.amazonaws.com"
                                ]
                            }
                        }
                    ]
                }
            }
        },
        "BucketBackupPolicy": {
            "Type": "AWS::IAM::Policy",
            "Properties": {
                "PolicyDocument": {
                    "Statement": [
                        {
                            "Action": [
                                "s3:GetReplicationConfiguration",
                                "s3:ListBucket"
                            ],
                            "Effect": "Allow",
                            "Resource": [
                                {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "arn:aws:s3:::",
                                            {
                                                "Ref": "RecordServiceS3Bucket"
                                            }
                                        ]
                                    ]
                                }
                            ]
                        },
                        {
                            "Action": [
                                "s3:GetObjectVersion",
                                "s3:GetObjectVersionAcl"
                            ],
                            "Effect": "Allow",
                            "Resource": [
                                {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "arn:aws:s3:::",
                                            {
                                                "Ref": "RecordServiceS3Bucket"
                                            },
                                            "/*"
                                        ]
                                    ]
                                }
                            ]
                        },
                        {
                            "Action": [
                                "s3:ReplicateObject",
                                "s3:ReplicateDelete"
                            ],
                            "Effect": "Allow",
                            "Resource": [
                                {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "arn:aws:s3:::",
                                            {
                                                "Fn::Join": [
                                                    "-",
                                                    [
                                                        {
                                                            "Ref": "AWS::Region"
                                                        },
                                                        {
                                                            "Ref": "AWS::StackName"
                                                        },
                                                        "replicationbucket"
                                                    ]
                                                ]
                                            },
                                            "/*"
                                        ]
                                    ]
                                }
                            ]
                        }
                    ]
                },
                "PolicyName": "BucketBackupPolicy",
                "Roles": [
                    {
                        "Ref": "WorkItemBucketBackupRole"
                    }
                ]
            }
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-replicationrule--examples--Associate_a_replication_configuration_IAM_role_with_an_S3_bucket--yaml"></a>

```
Resources:
  RecordServiceS3Bucket:
    Type: 'AWS::S3::Bucket'
    DeletionPolicy: Retain
    Properties:
      ReplicationConfiguration:
        Role: !GetAtt
          - WorkItemBucketBackupRole
          - Arn
        Rules:
          - Destination:
              Bucket: !Join
                - ''
                - - 'arn:aws:s3:::'
                  - !Join
                    - '-'
                    - - !Ref 'AWS::Region'
                      - !Ref 'AWS::StackName'
                      - replicationbucket
              StorageClass: STANDARD
            Id: Backup
            Prefix: ''
            Status: Enabled
      VersioningConfiguration:
        Status: Enabled
  WorkItemBucketBackupRole:
    Type: 'AWS::IAM::Role'
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Action:
              - 'sts:AssumeRole'
            Effect: Allow
            Principal:
              Service:
                - s3.amazonaws.com
  BucketBackupPolicy:
    Type: 'AWS::IAM::Policy'
    Properties:
      PolicyDocument:
        Statement:
          - Action:
              - 's3:GetReplicationConfiguration'
              - 's3:ListBucket'
            Effect: Allow
            Resource:
              - !Join
                - ''
                - - 'arn:aws:s3:::'
                  - !Ref RecordServiceS3Bucket
          - Action:
              - 's3:GetObjectVersion'
              - 's3:GetObjectVersionAcl'
            Effect: Allow
            Resource:
              - !Join
                - ''
                - - 'arn:aws:s3:::'
                  - !Ref RecordServiceS3Bucket
                  - /*
          - Action:
              - 's3:ReplicateObject'
              - 's3:ReplicateDelete'
            Effect: Allow
            Resource:
              - !Join
                - ''
                - - 'arn:aws:s3:::'
                  - !Join
                    - '-'
                    - - !Ref 'AWS::Region'
                      - !Ref 'AWS::StackName'
                      - replicationbucket
                  - /*
      PolicyName: BucketBackupPolicy
      Roles:
        - !Ref WorkItemBucketBackupRole
```

### Enable versioning and replicate objects
<a name="aws-properties-s3-bucket-replicationrule--examples--Enable_versioning_and_replicate_objects"></a>

The following example enables versioning and two replication rules. The rules copy objects prefixed with either `MyPrefix` and `MyOtherPrefix` and stores the copied objects in a bucket named `my-replication-bucket`.

#### JSON
<a name="aws-properties-s3-bucket-replicationrule--examples--Enable_versioning_and_replicate_objects--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "VersioningConfiguration": {
                    "Status": "Enabled"
                },
                "ReplicationConfiguration": {
                    "Role": "arn:aws:iam::123456789012:role/replication_role",
                    "Rules": [
                        {
                            "Id": "MyRule1",
                            "Status": "Enabled",
                            "Prefix": "MyPrefix",
                            "Destination": {
                                "Bucket": "arn:aws:s3:::my-replication-bucket",
                                "StorageClass": "STANDARD"
                            }
                        },
                        {
                            "Status": "Enabled",
                            "Prefix": "MyOtherPrefix",
                            "Destination": {
                                "Bucket": "arn:aws:s3:::my-replication-bucket"
                            }
                        }
                    ]
                }
            }
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-replicationrule--examples--Enable_versioning_and_replicate_objects--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      VersioningConfiguration:
        Status: Enabled
      ReplicationConfiguration:
        Role: 'arn:aws:iam::123456789012:role/replication_role'
        Rules:
          - Id: MyRule1
            Status: Enabled
            Prefix: MyPrefix
            Destination:
              Bucket: 'arn:aws:s3:::my-replication-bucket'
              StorageClass: STANDARD
          - Status: Enabled
            Prefix: MyOtherPrefix
            Destination:
              Bucket: 'arn:aws:s3:::my-replication-bucket'
```

# AWS::S3::Bucket ReplicationRuleAndOperator
<a name="aws-properties-s3-bucket-replicationruleandoperator"></a>

A container for specifying rule filters. The filters determine the subset of objects to which the rule applies. This element is required only if you specify more than one filter. 

For example:
+ If you specify both a `Prefix` and a `TagFilter`, wrap these filters in an `And` tag. 
+ If you specify a filter based on multiple tags, wrap the `TagFilter` elements in an `And` tag

## Syntax
<a name="aws-properties-s3-bucket-replicationruleandoperator-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-replicationruleandoperator-syntax.json"></a>

```
{
  "[Prefix](#cfn-s3-bucket-replicationruleandoperator-prefix)" : String,
  "[TagFilters](#cfn-s3-bucket-replicationruleandoperator-tagfilters)" : [ TagFilter, ... ]
}
```

### YAML
<a name="aws-properties-s3-bucket-replicationruleandoperator-syntax.yaml"></a>

```
  [Prefix](#cfn-s3-bucket-replicationruleandoperator-prefix): String
  [TagFilters](#cfn-s3-bucket-replicationruleandoperator-tagfilters): 
    - TagFilter
```

## Properties
<a name="aws-properties-s3-bucket-replicationruleandoperator-properties"></a>

`Prefix`  <a name="cfn-s3-bucket-replicationruleandoperator-prefix"></a>
An object key name prefix that identifies the subset of objects to which the rule applies.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TagFilters`  <a name="cfn-s3-bucket-replicationruleandoperator-tagfilters"></a>
An array of tags containing key and value pairs.  
*Required*: No  
*Type*: Array of [TagFilter](aws-properties-s3-bucket-tagfilter.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket ReplicationRuleFilter
<a name="aws-properties-s3-bucket-replicationrulefilter"></a>

A filter that identifies the subset of objects to which the replication rule applies. A `Filter` must specify exactly one `Prefix`, `TagFilter`, or an `And` child element.

## Syntax
<a name="aws-properties-s3-bucket-replicationrulefilter-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-replicationrulefilter-syntax.json"></a>

```
{
  "[And](#cfn-s3-bucket-replicationrulefilter-and)" : ReplicationRuleAndOperator,
  "[Prefix](#cfn-s3-bucket-replicationrulefilter-prefix)" : String,
  "[TagFilter](#cfn-s3-bucket-replicationrulefilter-tagfilter)" : TagFilter
}
```

### YAML
<a name="aws-properties-s3-bucket-replicationrulefilter-syntax.yaml"></a>

```
  [And](#cfn-s3-bucket-replicationrulefilter-and): 
    ReplicationRuleAndOperator
  [Prefix](#cfn-s3-bucket-replicationrulefilter-prefix): String
  [TagFilter](#cfn-s3-bucket-replicationrulefilter-tagfilter): 
    TagFilter
```

## Properties
<a name="aws-properties-s3-bucket-replicationrulefilter-properties"></a>

`And`  <a name="cfn-s3-bucket-replicationrulefilter-and"></a>
A container for specifying rule filters. The filters determine the subset of objects to which the rule applies. This element is required only if you specify more than one filter. For example:   
+ If you specify both a `Prefix` and a `TagFilter`, wrap these filters in an `And` tag.
+ If you specify a filter based on multiple tags, wrap the `TagFilter` elements in an `And` tag.
*Required*: No  
*Type*: [ReplicationRuleAndOperator](aws-properties-s3-bucket-replicationruleandoperator.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Prefix`  <a name="cfn-s3-bucket-replicationrulefilter-prefix"></a>
An object key name prefix that identifies the subset of objects to which the rule applies.  
Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see [ XML related object key constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints).
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TagFilter`  <a name="cfn-s3-bucket-replicationrulefilter-tagfilter"></a>
A container for specifying a tag key and value.   
The rule applies only to objects that have the tag in their tag set.  
*Required*: No  
*Type*: [TagFilter](aws-properties-s3-bucket-tagfilter.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket ReplicationTime
<a name="aws-properties-s3-bucket-replicationtime"></a>

 A container specifying S3 Replication Time Control (S3 RTC) related information, including whether S3 RTC is enabled and the time when all objects and operations on objects must be replicated. Must be specified together with a `Metrics` block. 

## Syntax
<a name="aws-properties-s3-bucket-replicationtime-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-replicationtime-syntax.json"></a>

```
{
  "[Status](#cfn-s3-bucket-replicationtime-status)" : String,
  "[Time](#cfn-s3-bucket-replicationtime-time)" : ReplicationTimeValue
}
```

### YAML
<a name="aws-properties-s3-bucket-replicationtime-syntax.yaml"></a>

```
  [Status](#cfn-s3-bucket-replicationtime-status): String
  [Time](#cfn-s3-bucket-replicationtime-time): 
    ReplicationTimeValue
```

## Properties
<a name="aws-properties-s3-bucket-replicationtime-properties"></a>

`Status`  <a name="cfn-s3-bucket-replicationtime-status"></a>
 Specifies whether the replication time is enabled.   
*Required*: Yes  
*Type*: String  
*Allowed values*: `Disabled | Enabled`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Time`  <a name="cfn-s3-bucket-replicationtime-time"></a>
 A container specifying the time by which replication should be complete for all objects and operations on objects.   
*Required*: Yes  
*Type*: [ReplicationTimeValue](aws-properties-s3-bucket-replicationtimevalue.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-replicationtime--examples"></a>



### Enable S3 Replication Time Control
<a name="aws-properties-s3-bucket-replicationtime--examples--Enable_S3_Replication_Time_Control"></a>

The following example creates a replication configuration with S3 Replication Time Control (S3 RTC) enabled. To use this example, replace *amzn-s3-demo-source-bucket* with the name of your source bucket and replace *amzn-s3-demo-destination-bucket* with the name of your destination bucket. Make sure to update the AWS Identity and Access Management (IAM) role and the replication rule as needed.

#### JSON
<a name="aws-properties-s3-bucket-replicationtime--examples--Enable_S3_Replication_Time_Control--json"></a>

```
      {
    "AWSTemplateFormatVersion": "2010-09-09",
    "Description": "AWS CloudFormation Template for S3 Bucket Replication",
    "Resources": {
      "MyS3Bucket": {
        "Type": "AWS::S3::Bucket",
        "Properties": {
          "BucketName": "amzn-s3-demo-source-bucket",
          "VersioningConfiguration": {
            "Status": "Enabled"
          },
          "ReplicationConfiguration": {
            "Role": "arn:aws:iam::account:role/s3-replication-role",
            "Rules": [
              {
                "Id": "ReplicationRule1",
                "Status": "Enabled",
                "Filter": {
                  "Prefix": ""
                },
                "Destination": {
                  "Bucket": "arn:aws:s3:::amzn-s3-demo-destination-bucket",
                  "ReplicationTime": {
                    "Status": "Enabled",
                    "Time": {
                      "Minutes": 15
                    }
                  },
                  "Metrics": {
                    "Status": "Enabled",
                    "EventThreshold": {
                      "Minutes": 15
                    }
                  }
                },
                "Priority": 1,
                "DeleteMarkerReplication": {
                  "Status": "Enabled"
                },
                "SourceSelectionCriteria": {
                  "ReplicaModifications": {
                    "Status": "Disabled"
                  }
                }
              }
            ]
          }
        }
      }
    }
  }
```

#### YAML
<a name="aws-properties-s3-bucket-replicationtime--examples--Enable_S3_Replication_Time_Control--yaml"></a>

```
        AWSTemplateFormatVersion: '2010-09-09'
Description: 'AWS CloudFormation Template for S3 Bucket Replication'

Resources:
  MyS3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      BucketName: 'amzn-s3-demo-source-bucket'
      VersioningConfiguration:
        Status: 'Enabled'
      ReplicationConfiguration:
        Role: 'arn:aws:iam::account:role/s3-replication-role'
        Rules:
          - Id: 'ReplicationRule1'
            Status: 'Enabled'
            Filter:
              Prefix: ""
            Destination:
              Bucket: 'arn:aws:s3:::amzn-s3-demo-destination-bucket'
              ReplicationTime:
                  Status: Enabled 
                  Time:
                    Minutes: 15
              Metrics:
                Status: Enabled
                EventThreshold:
                  Minutes: 15
            Priority: 1
            DeleteMarkerReplication:
              Status: Enabled 
            SourceSelectionCriteria:
              ReplicaModifications:
                Status: Disabled
```

# AWS::S3::Bucket ReplicationTimeValue
<a name="aws-properties-s3-bucket-replicationtimevalue"></a>

 A container specifying the time value for S3 Replication Time Control (S3 RTC) and replication metrics `EventThreshold`. 

## Syntax
<a name="aws-properties-s3-bucket-replicationtimevalue-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-replicationtimevalue-syntax.json"></a>

```
{
  "[Minutes](#cfn-s3-bucket-replicationtimevalue-minutes)" : Integer
}
```

### YAML
<a name="aws-properties-s3-bucket-replicationtimevalue-syntax.yaml"></a>

```
  [Minutes](#cfn-s3-bucket-replicationtimevalue-minutes): Integer
```

## Properties
<a name="aws-properties-s3-bucket-replicationtimevalue-properties"></a>

`Minutes`  <a name="cfn-s3-bucket-replicationtimevalue-minutes"></a>
 Contains an integer specifying time in minutes.   
 Valid value: 15  
*Required*: Yes  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket RoutingRule
<a name="aws-properties-s3-bucket-routingrule"></a>

Specifies the redirect behavior and when a redirect is applied. For more information about routing rules, see [Configuring advanced conditional redirects](https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html#advanced-conditional-redirects) in the *Amazon S3 User Guide*.

## Syntax
<a name="aws-properties-s3-bucket-routingrule-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-routingrule-syntax.json"></a>

```
{
  "[RedirectRule](#cfn-s3-bucket-routingrule-redirectrule)" : RedirectRule,
  "[RoutingRuleCondition](#cfn-s3-bucket-routingrule-routingrulecondition)" : RoutingRuleCondition
}
```

### YAML
<a name="aws-properties-s3-bucket-routingrule-syntax.yaml"></a>

```
  [RedirectRule](#cfn-s3-bucket-routingrule-redirectrule): 
    RedirectRule
  [RoutingRuleCondition](#cfn-s3-bucket-routingrule-routingrulecondition): 
    RoutingRuleCondition
```

## Properties
<a name="aws-properties-s3-bucket-routingrule-properties"></a>

`RedirectRule`  <a name="cfn-s3-bucket-routingrule-redirectrule"></a>
Container for redirect information. You can redirect requests to another host, to another page, or with another protocol. In the event of an error, you can specify a different error code to return.  
*Required*: Yes  
*Type*: [RedirectRule](aws-properties-s3-bucket-redirectrule.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RoutingRuleCondition`  <a name="cfn-s3-bucket-routingrule-routingrulecondition"></a>
A container for describing a condition that must be met for the specified redirect to apply. For example, 1. If request is for pages in the `/docs` folder, redirect to the `/documents` folder. 2. If request results in HTTP error 4xx, redirect request to another host where you might process the error.  
*Required*: No  
*Type*: [RoutingRuleCondition](aws-properties-s3-bucket-routingrulecondition.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-routingrule--examples"></a>



### Configure a static website with a routing rule
<a name="aws-properties-s3-bucket-routingrule--examples--Configure_a_static_website_with_a_routing_rule"></a>

In this example, `AWS::S3::Bucket's Fn::GetAtt` values are used to provide outputs. If an HTTP 404 error occurs, the routing rule redirects requests to an EC2 instance and inserts the object key prefix `report-404/` in the redirect. For example, if you request a page called `out1/ExamplePage.html` and it results in an HTTP 404 error, the request is routed to a page called `report-404/ExamplePage.html` on the specified instance. For all other HTTP error codes, `error.html` is returned. 

This example also specifies a metrics configuration called `EntireBucket` that enables CloudWatch request metrics at the bucket level.

#### JSON
<a name="aws-properties-s3-bucket-routingrule--examples--Configure_a_static_website_with_a_routing_rule--json"></a>

```
{
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "AccessControl": "PublicRead",
                "BucketName": "public-bucket",
                "MetricsConfigurations": [
                    {
                        "Id": "EntireBucket"
                    }
                ],
                "WebsiteConfiguration": {
                    "IndexDocument": "index.html",
                    "ErrorDocument": "error.html",
                    "RoutingRules": [
                        {
                            "RoutingRuleCondition": {
                                "HttpErrorCodeReturnedEquals": "404",
                                "KeyPrefixEquals": "out1/"
                            },
                            "RedirectRule": {
                                "HostName": "ec2-11-22-333-44.compute-1.amazonaws.com",
                                "ReplaceKeyPrefixWith": "report-404/"
                            }
                        }
                    ]
                }
            },
            "DeletionPolicy": "Retain"
        }
    },
    "Outputs": {
        "WebsiteURL": {
            "Value": {
                "Fn::GetAtt": [
                    "S3Bucket",
                    "WebsiteURL"
                ]
            },
            "Description": "URL for website hosted on S3"
        },
        "S3BucketSecureURL": {
            "Value": {
                "Fn::Join": [
                    "",
                    [
                        "https://",
                        {
                            "Fn::GetAtt": [
                                "S3Bucket",
                                "DomainName"
                            ]
                        }
                    ]
                ]
            },
            "Description": "Name of S3 bucket to hold website content"
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-routingrule--examples--Configure_a_static_website_with_a_routing_rule--yaml"></a>

```
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      AccessControl: PublicRead
      BucketName: public-bucket
      MetricsConfigurations:
        - Id: EntireBucket
      WebsiteConfiguration:
        IndexDocument: index.html
        ErrorDocument: error.html
        RoutingRules:
          - RoutingRuleCondition:
              HttpErrorCodeReturnedEquals: '404'
              KeyPrefixEquals: out1/
            RedirectRule:
              HostName: ec2-11-22-333-44.compute-1.amazonaws.com
              ReplaceKeyPrefixWith: report-404/
    DeletionPolicy: Retain
Outputs:
  WebsiteURL:
    Value: !GetAtt
      - S3Bucket
      - WebsiteURL
    Description: URL for website hosted on S3
  S3BucketSecureURL:
    Value: !Join
      - ''
      - - 'https://'
        - !GetAtt
          - S3Bucket
          - DomainName
    Description: Name of S3 bucket to hold website content
```

# AWS::S3::Bucket RoutingRuleCondition
<a name="aws-properties-s3-bucket-routingrulecondition"></a>

A container for describing a condition that must be met for the specified redirect to apply. For example, 1. If request is for pages in the `/docs` folder, redirect to the `/documents` folder. 2. If request results in HTTP error 4xx, redirect request to another host where you might process the error.

## Syntax
<a name="aws-properties-s3-bucket-routingrulecondition-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-routingrulecondition-syntax.json"></a>

```
{
  "[HttpErrorCodeReturnedEquals](#cfn-s3-bucket-routingrulecondition-httperrorcodereturnedequals)" : String,
  "[KeyPrefixEquals](#cfn-s3-bucket-routingrulecondition-keyprefixequals)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-routingrulecondition-syntax.yaml"></a>

```
  [HttpErrorCodeReturnedEquals](#cfn-s3-bucket-routingrulecondition-httperrorcodereturnedequals): String
  [KeyPrefixEquals](#cfn-s3-bucket-routingrulecondition-keyprefixequals): String
```

## Properties
<a name="aws-properties-s3-bucket-routingrulecondition-properties"></a>

`HttpErrorCodeReturnedEquals`  <a name="cfn-s3-bucket-routingrulecondition-httperrorcodereturnedequals"></a>
The HTTP error code when the redirect is applied. In the event of an error, if the error code equals this value, then the specified redirect is applied.  
Required when parent element `Condition` is specified and sibling `KeyPrefixEquals` is not specified. If both are specified, then both must be true for the redirect to be applied.  
*Required*: Conditional  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`KeyPrefixEquals`  <a name="cfn-s3-bucket-routingrulecondition-keyprefixequals"></a>
The object key name prefix when the redirect is applied. For example, to redirect requests for `ExamplePage.html`, the key prefix will be `ExamplePage.html`. To redirect request for all pages with the prefix `docs/`, the key prefix will be `docs/`, which identifies all objects in the docs/ folder.  
Required when the parent element `Condition` is specified and sibling `HttpErrorCodeReturnedEquals` is not specified. If both conditions are specified, both must be true for the redirect to be applied.  
*Required*: Conditional  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-routingrulecondition--examples"></a>



### Configure a static website with a routing rule
<a name="aws-properties-s3-bucket-routingrulecondition--examples--Configure_a_static_website_with_a_routing_rule"></a>

In this example, `AWS::S3::Bucket's Fn::GetAtt` values are used to provide outputs. If an HTTP 404 error occurs, the routing rule redirects requests to an EC2 instance and inserts the object key prefix `report-404/` in the redirect. For example, if you request a page called `out1/ExamplePage.html` and it results in an HTTP 404 error, the request is routed to a page called `report-404/ExamplePage.html` on the specified instance. For all other HTTP error codes, `error.html` is returned. 

This example also specifies a metrics configuration called `EntireBucket` that enables CloudWatch request metrics at the bucket level.

#### JSON
<a name="aws-properties-s3-bucket-routingrulecondition--examples--Configure_a_static_website_with_a_routing_rule--json"></a>

```
{
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "AccessControl": "PublicRead",
                "BucketName": "public-bucket",
                "MetricsConfigurations": [
                    {
                        "Id": "EntireBucket"
                    }
                ],
                "WebsiteConfiguration": {
                    "IndexDocument": "index.html",
                    "ErrorDocument": "error.html",
                    "RoutingRules": [
                        {
                            "RoutingRuleCondition": {
                                "HttpErrorCodeReturnedEquals": "404",
                                "KeyPrefixEquals": "out1/"
                            },
                            "RedirectRule": {
                                "HostName": "ec2-11-22-333-44.compute-1.amazonaws.com",
                                "ReplaceKeyPrefixWith": "report-404/"
                            }
                        }
                    ]
                }
            },
            "DeletionPolicy": "Retain"
        }
    },
    "Outputs": {
        "WebsiteURL": {
            "Value": {
                "Fn::GetAtt": [
                    "S3Bucket",
                    "WebsiteURL"
                ]
            },
            "Description": "URL for website hosted on S3"
        },
        "S3BucketSecureURL": {
            "Value": {
                "Fn::Join": [
                    "",
                    [
                        "https://",
                        {
                            "Fn::GetAtt": [
                                "S3Bucket",
                                "DomainName"
                            ]
                        }
                    ]
                ]
            },
            "Description": "Name of S3 bucket to hold website content"
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-routingrulecondition--examples--Configure_a_static_website_with_a_routing_rule--yaml"></a>

```
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      AccessControl: PublicRead
      BucketName: public-bucket
      MetricsConfigurations:
        - Id: EntireBucket
      WebsiteConfiguration:
        IndexDocument: index.html
        ErrorDocument: error.html
        RoutingRules:
          - RoutingRuleCondition:
              HttpErrorCodeReturnedEquals: '404'
              KeyPrefixEquals: out1/
            RedirectRule:
              HostName: ec2-11-22-333-44.compute-1.amazonaws.com
              ReplaceKeyPrefixWith: report-404/
    DeletionPolicy: Retain
Outputs:
  WebsiteURL:
    Value: !GetAtt
      - S3Bucket
      - WebsiteURL
    Description: URL for website hosted on S3
  S3BucketSecureURL:
    Value: !Join
      - ''
      - - 'https://'
        - !GetAtt
          - S3Bucket
          - DomainName
    Description: Name of S3 bucket to hold website content
```

# AWS::S3::Bucket Rule
<a name="aws-properties-s3-bucket-rule"></a>

Specifies lifecycle rules for an Amazon S3 bucket. For more information, see [Put Bucket Lifecycle Configuration](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlifecycle.html) in the *Amazon S3 API Reference*.

You must specify at least one of the following properties: `AbortIncompleteMultipartUpload`, `ExpirationDate`, `ExpirationInDays`, `NoncurrentVersionExpirationInDays`, `NoncurrentVersionTransition`, `NoncurrentVersionTransitions`, `Transition`, or `Transitions`.

## Syntax
<a name="aws-properties-s3-bucket-rule-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-rule-syntax.json"></a>

```
{
  "[AbortIncompleteMultipartUpload](#cfn-s3-bucket-rule-abortincompletemultipartupload)" : AbortIncompleteMultipartUpload,
  "[ExpirationDate](#cfn-s3-bucket-rule-expirationdate)" : String,
  "[ExpirationInDays](#cfn-s3-bucket-rule-expirationindays)" : Integer,
  "[ExpiredObjectDeleteMarker](#cfn-s3-bucket-rule-expiredobjectdeletemarker)" : Boolean,
  "[Id](#cfn-s3-bucket-rule-id)" : String,
  "[NoncurrentVersionExpiration](#cfn-s3-bucket-rule-noncurrentversionexpiration)" : NoncurrentVersionExpiration,
  "[NoncurrentVersionExpirationInDays](#cfn-s3-bucket-rule-noncurrentversionexpirationindays)" : Integer,
  "[NoncurrentVersionTransition](#cfn-s3-bucket-rule-noncurrentversiontransition)" : NoncurrentVersionTransition,
  "[NoncurrentVersionTransitions](#cfn-s3-bucket-rule-noncurrentversiontransitions)" : [ NoncurrentVersionTransition, ... ],
  "[ObjectSizeGreaterThan](#cfn-s3-bucket-rule-objectsizegreaterthan)" : String,
  "[ObjectSizeLessThan](#cfn-s3-bucket-rule-objectsizelessthan)" : String,
  "[Prefix](#cfn-s3-bucket-rule-prefix)" : String,
  "[Status](#cfn-s3-bucket-rule-status)" : String,
  "[TagFilters](#cfn-s3-bucket-rule-tagfilters)" : [ TagFilter, ... ],
  "[Transition](#cfn-s3-bucket-rule-transition)" : Transition,
  "[Transitions](#cfn-s3-bucket-rule-transitions)" : [ Transition, ... ]
}
```

### YAML
<a name="aws-properties-s3-bucket-rule-syntax.yaml"></a>

```
  [AbortIncompleteMultipartUpload](#cfn-s3-bucket-rule-abortincompletemultipartupload): 
    AbortIncompleteMultipartUpload
  [ExpirationDate](#cfn-s3-bucket-rule-expirationdate): String
  [ExpirationInDays](#cfn-s3-bucket-rule-expirationindays): Integer
  [ExpiredObjectDeleteMarker](#cfn-s3-bucket-rule-expiredobjectdeletemarker): Boolean
  [Id](#cfn-s3-bucket-rule-id): String
  [NoncurrentVersionExpiration](#cfn-s3-bucket-rule-noncurrentversionexpiration): 
    NoncurrentVersionExpiration
  [NoncurrentVersionExpirationInDays](#cfn-s3-bucket-rule-noncurrentversionexpirationindays): Integer
  [NoncurrentVersionTransition](#cfn-s3-bucket-rule-noncurrentversiontransition): 
    NoncurrentVersionTransition
  [NoncurrentVersionTransitions](#cfn-s3-bucket-rule-noncurrentversiontransitions): 
    - NoncurrentVersionTransition
  [ObjectSizeGreaterThan](#cfn-s3-bucket-rule-objectsizegreaterthan): String
  [ObjectSizeLessThan](#cfn-s3-bucket-rule-objectsizelessthan): String
  [Prefix](#cfn-s3-bucket-rule-prefix): String
  [Status](#cfn-s3-bucket-rule-status): String
  [TagFilters](#cfn-s3-bucket-rule-tagfilters): 
    - TagFilter
  [Transition](#cfn-s3-bucket-rule-transition): 
    Transition
  [Transitions](#cfn-s3-bucket-rule-transitions): 
    - Transition
```

## Properties
<a name="aws-properties-s3-bucket-rule-properties"></a>

`AbortIncompleteMultipartUpload`  <a name="cfn-s3-bucket-rule-abortincompletemultipartupload"></a>
Specifies a lifecycle rule that stops incomplete multipart uploads to an Amazon S3 bucket.  
*Required*: Conditional  
*Type*: [AbortIncompleteMultipartUpload](aws-properties-s3-bucket-abortincompletemultipartupload.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ExpirationDate`  <a name="cfn-s3-bucket-rule-expirationdate"></a>
Indicates when objects are deleted from Amazon S3 and Amazon S3 Glacier. The date value must be in ISO 8601 format. The time is always midnight UTC. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time.  
*Required*: Conditional  
*Type*: String  
*Pattern*: `^(\d{4})-(0[0-9]|1[0-2])-([0-2]\d|3[01])T([01]\d|2[0-4]):([0-5]\d):([0-6]\d)((\.\d{3})?)Z$`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ExpirationInDays`  <a name="cfn-s3-bucket-rule-expirationindays"></a>
Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon S3 Glacier. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time.  
*Required*: Conditional  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ExpiredObjectDeleteMarker`  <a name="cfn-s3-bucket-rule-expiredobjectdeletemarker"></a>
Indicates whether Amazon S3 will remove a delete marker without any noncurrent versions. If set to true, the delete marker will be removed if there are no noncurrent versions. This cannot be specified with `ExpirationInDays`, `ExpirationDate`, or `TagFilters`.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Id`  <a name="cfn-s3-bucket-rule-id"></a>
Unique identifier for the rule. The value can't be longer than 255 characters.  
*Required*: No  
*Type*: String  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`NoncurrentVersionExpiration`  <a name="cfn-s3-bucket-rule-noncurrentversionexpiration"></a>
Specifies when noncurrent object versions expire. Upon expiration, Amazon S3 permanently deletes the noncurrent object versions. You set this lifecycle configuration action on a bucket that has versioning enabled (or suspended) to request that Amazon S3 delete noncurrent object versions at a specific period in the object's lifetime.  
*Required*: No  
*Type*: [NoncurrentVersionExpiration](aws-properties-s3-bucket-noncurrentversionexpiration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`NoncurrentVersionExpirationInDays`  <a name="cfn-s3-bucket-rule-noncurrentversionexpirationindays"></a>
(Deprecated.) For buckets with versioning enabled (or suspended), specifies the time, in days, between when a new version of the object is uploaded to the bucket and when old versions of the object expire. When object versions expire, Amazon S3 permanently deletes them. If you specify a transition and expiration time, the expiration time must be later than the transition time.  
*Required*: Conditional  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`NoncurrentVersionTransition`  <a name="cfn-s3-bucket-rule-noncurrentversiontransition"></a>
(Deprecated.) For buckets with versioning enabled (or suspended), specifies when non-current objects transition to a specified storage class. If you specify a transition and expiration time, the expiration time must be later than the transition time. If you specify this property, don't specify the `NoncurrentVersionTransitions` property.  
*Required*: Conditional  
*Type*: [NoncurrentVersionTransition](aws-properties-s3-bucket-noncurrentversiontransition.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`NoncurrentVersionTransitions`  <a name="cfn-s3-bucket-rule-noncurrentversiontransitions"></a>
For buckets with versioning enabled (or suspended), one or more transition rules that specify when non-current objects transition to a specified storage class. If you specify a transition and expiration time, the expiration time must be later than the transition time. If you specify this property, don't specify the `NoncurrentVersionTransition` property.  
*Required*: Conditional  
*Type*: Array of [NoncurrentVersionTransition](aws-properties-s3-bucket-noncurrentversiontransition.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ObjectSizeGreaterThan`  <a name="cfn-s3-bucket-rule-objectsizegreaterthan"></a>
Specifies the minimum object size in bytes for this rule to apply to. Objects must be larger than this value in bytes. For more information about size based rules, see [Lifecycle configuration using size-based rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-configuration-examples.html#lc-size-rules) in the *Amazon S3 User Guide*.  
*Required*: No  
*Type*: String  
*Pattern*: `[0-9]+`  
*Maximum*: `20`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ObjectSizeLessThan`  <a name="cfn-s3-bucket-rule-objectsizelessthan"></a>
Specifies the maximum object size in bytes for this rule to apply to. Objects must be smaller than this value in bytes. For more information about sized based rules, see [Lifecycle configuration using size-based rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-configuration-examples.html#lc-size-rules) in the *Amazon S3 User Guide*.  
*Required*: No  
*Type*: String  
*Pattern*: `[0-9]+`  
*Maximum*: `20`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Prefix`  <a name="cfn-s3-bucket-rule-prefix"></a>
Object key prefix that identifies one or more objects to which this rule applies.  
Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see [ XML related object key constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints).
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Status`  <a name="cfn-s3-bucket-rule-status"></a>
If `Enabled`, the rule is currently being applied. If `Disabled`, the rule is not currently being applied.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `Enabled | Disabled`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TagFilters`  <a name="cfn-s3-bucket-rule-tagfilters"></a>
Tags to use to identify a subset of objects to which the lifecycle rule applies.  
*Required*: No  
*Type*: Array of [TagFilter](aws-properties-s3-bucket-tagfilter.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Transition`  <a name="cfn-s3-bucket-rule-transition"></a>
(Deprecated.) Specifies when an object transitions to a specified storage class. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time. If you specify this property, don't specify the `Transitions` property.  
*Required*: Conditional  
*Type*: [Transition](aws-properties-s3-bucket-transition.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Transitions`  <a name="cfn-s3-bucket-rule-transitions"></a>
One or more transition rules that specify when an object transitions to a specified storage class. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time. If you specify this property, don't specify the `Transition` property.  
*Required*: Conditional  
*Type*: Array of [Transition](aws-properties-s3-bucket-transition.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-rule--examples"></a>



### Manage the lifecycle for S3 objects
<a name="aws-properties-s3-bucket-rule--examples--Manage_the_lifecycle_for_S3_objects"></a>

The following example template shows an S3 bucket with a lifecycle configuration rule. The rule applies to all objects with the `glacier` key prefix. The objects are transitioned to Glacier after one day, and deleted after one year.

#### JSON
<a name="aws-properties-s3-bucket-rule--examples--Manage_the_lifecycle_for_S3_objects--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "AccessControl": "Private",
                "LifecycleConfiguration": {
                    "Rules": [
                        {
                            "Id": "GlacierRule",
                            "Prefix": "glacier",
                            "Status": "Enabled",
                            "ExpirationInDays": 365,
                            "Transitions": [
                                {
                                    "TransitionInDays": 1,
                                    "StorageClass": "GLACIER"
                                }
                            ]
                        }
                    ]
                }
            }
        }
    },
    "Outputs": {
        "BucketName": {
            "Value": {
                "Ref": "S3Bucket"
            },
            "Description": "Name of the sample Amazon S3 bucket with a lifecycle configuration."
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-rule--examples--Manage_the_lifecycle_for_S3_objects--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      AccessControl: Private
      LifecycleConfiguration:
        Rules:
          - Id: GlacierRule
            Prefix: glacier
            Status: Enabled
            ExpirationInDays: 365
            Transitions:
              - TransitionInDays: 1
                StorageClass: GLACIER
Outputs:
  BucketName:
    Value: !Ref S3Bucket
    Description: Name of the sample Amazon S3 bucket with a lifecycle configuration.
```

## See also
<a name="aws-properties-s3-bucket-rule--seealso"></a>
+ AWS::S3::Bucket [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#aws-properties-s3-bucket--examples)



# AWS::S3::Bucket S3KeyFilter
<a name="aws-properties-s3-bucket-s3keyfilter"></a>

A container for object key name prefix and suffix filtering rules. For more information about object key name filtering, see [Configuring event notifications using object key name filtering](https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) in the *Amazon S3 User Guide*.

**Note**  
The same type of filter rule cannot be used more than once. For example, you cannot specify two prefix rules.

## Syntax
<a name="aws-properties-s3-bucket-s3keyfilter-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-s3keyfilter-syntax.json"></a>

```
{
  "[Rules](#cfn-s3-bucket-s3keyfilter-rules)" : [ FilterRule, ... ]
}
```

### YAML
<a name="aws-properties-s3-bucket-s3keyfilter-syntax.yaml"></a>

```
  [Rules](#cfn-s3-bucket-s3keyfilter-rules): 
    - FilterRule
```

## Properties
<a name="aws-properties-s3-bucket-s3keyfilter-properties"></a>

`Rules`  <a name="cfn-s3-bucket-s3keyfilter-rules"></a>
A list of containers for the key-value pair that defines the criteria for the filter rule.  
*Required*: Yes  
*Type*: Array of [FilterRule](aws-properties-s3-bucket-filterrule.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket S3TablesDestination
<a name="aws-properties-s3-bucket-s3tablesdestination"></a>

 The destination information for a V1 S3 Metadata configuration. The destination table bucket must be in the same Region and AWS account as the general purpose bucket. The specified metadata table name must be unique within the `aws_s3_metadata` namespace in the destination table bucket. 

## Syntax
<a name="aws-properties-s3-bucket-s3tablesdestination-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-s3tablesdestination-syntax.json"></a>

```
{
  "[TableArn](#cfn-s3-bucket-s3tablesdestination-tablearn)" : String,
  "[TableBucketArn](#cfn-s3-bucket-s3tablesdestination-tablebucketarn)" : String,
  "[TableName](#cfn-s3-bucket-s3tablesdestination-tablename)" : String,
  "[TableNamespace](#cfn-s3-bucket-s3tablesdestination-tablenamespace)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-s3tablesdestination-syntax.yaml"></a>

```
  [TableArn](#cfn-s3-bucket-s3tablesdestination-tablearn): String
  [TableBucketArn](#cfn-s3-bucket-s3tablesdestination-tablebucketarn): String
  [TableName](#cfn-s3-bucket-s3tablesdestination-tablename): String
  [TableNamespace](#cfn-s3-bucket-s3tablesdestination-tablenamespace): String
```

## Properties
<a name="aws-properties-s3-bucket-s3tablesdestination-properties"></a>

`TableArn`  <a name="cfn-s3-bucket-s3tablesdestination-tablearn"></a>
The Amazon Resource Name (ARN) for the metadata table in the metadata table configuration. The specified metadata table name must be unique within the `aws_s3_metadata` namespace in the destination table bucket.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TableBucketArn`  <a name="cfn-s3-bucket-s3tablesdestination-tablebucketarn"></a>
 The Amazon Resource Name (ARN) for the table bucket that's specified as the destination in the metadata table configuration. The destination table bucket must be in the same Region and AWS account as the general purpose bucket.   
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TableName`  <a name="cfn-s3-bucket-s3tablesdestination-tablename"></a>
 The name for the metadata table in your metadata table configuration. The specified metadata table name must be unique within the `aws_s3_metadata` namespace in the destination table bucket.   
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TableNamespace`  <a name="cfn-s3-bucket-s3tablesdestination-tablenamespace"></a>
The table bucket namespace for the metadata table in your metadata table configuration. This value is always `aws_s3_metadata`.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket ServerSideEncryptionByDefault
<a name="aws-properties-s3-bucket-serversideencryptionbydefault"></a>

Describes the default server-side encryption to apply to new objects in the bucket. If a PUT Object request doesn't specify any server-side encryption, this default encryption will be applied. For more information, see [PutBucketEncryption](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTencryption.html).

**Note**  
**General purpose buckets** - If you don't specify a customer managed key at configuration, Amazon S3 automatically creates an AWS KMS key (`aws/s3`) in your AWS account the first time that you add an object encrypted with SSE-KMS to a bucket. By default, Amazon S3 uses this KMS key for SSE-KMS. 
**Directory buckets** - Your SSE-KMS configuration can only support 1 [customer managed key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) per directory bucket's lifetime. The [AWS managed key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk) (`aws/s3`) isn't supported. 
**Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: SSE-S3 and SSE-KMS.

## Syntax
<a name="aws-properties-s3-bucket-serversideencryptionbydefault-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-serversideencryptionbydefault-syntax.json"></a>

```
{
  "[KMSMasterKeyID](#cfn-s3-bucket-serversideencryptionbydefault-kmsmasterkeyid)" : String,
  "[SSEAlgorithm](#cfn-s3-bucket-serversideencryptionbydefault-ssealgorithm)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-serversideencryptionbydefault-syntax.yaml"></a>

```
  [KMSMasterKeyID](#cfn-s3-bucket-serversideencryptionbydefault-kmsmasterkeyid): String
  [SSEAlgorithm](#cfn-s3-bucket-serversideencryptionbydefault-ssealgorithm): String
```

## Properties
<a name="aws-properties-s3-bucket-serversideencryptionbydefault-properties"></a>

`KMSMasterKeyID`  <a name="cfn-s3-bucket-serversideencryptionbydefault-kmsmasterkeyid"></a>
AWS Key Management Service (KMS) customer managed key ID to use for the default encryption.   
+ **General purpose buckets** - This parameter is allowed if and only if `SSEAlgorithm` is set to `aws:kms` or `aws:kms:dsse`.
+ **Directory buckets** - This parameter is allowed if and only if `SSEAlgorithm` is set to `aws:kms`.
You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the KMS key.  
+ Key ID: `1234abcd-12ab-34cd-56ef-1234567890ab`
+ Key ARN: `arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`
+ Key Alias: `alias/alias-name`
If you are using encryption with cross-account or AWS service operations, you must use a fully qualified KMS key ARN. For more information, see [Using encryption for cross-account operations](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html#bucket-encryption-update-bucket-policy).  
+ **General purpose buckets** - If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then AWS KMS resolves the key within the requester’s account. This behavior can result in data that's encrypted with a KMS key that belongs to the requester, and not the bucket owner. Also, if you use a key ID, you can run into a LogDestination undeliverable error when creating a VPC flow log. 
+ **Directory buckets** - When you specify an [AWS KMS customer managed key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) for encryption in your directory bucket, only use the key ID or key ARN. The key alias format of the KMS key isn't supported.
Amazon S3 only supports symmetric encryption KMS keys. For more information, see [Asymmetric keys in AWS KMS](https://docs.aws.amazon.com//kms/latest/developerguide/symmetric-asymmetric.html) in the *AWS Key Management Service Developer Guide*.
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SSEAlgorithm`  <a name="cfn-s3-bucket-serversideencryptionbydefault-ssealgorithm"></a>
Server-side encryption algorithm to use for the default encryption.  
For directory buckets, there are only two supported values for server-side encryption: `AES256` and `aws:kms`.
*Required*: Yes  
*Type*: String  
*Allowed values*: `aws:kms | AES256 | aws:kms:dsse`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-serversideencryptionbydefault--examples"></a>

### Create a bucket with default encryption
<a name="aws-properties-s3-bucket-serversideencryptionbydefault--examples--Create_a_bucket_with_default_encryption"></a>

The following example creates a bucket with server-side bucket encryption configured. This example uses encryption with AWS KMS keys (SSE-KMS). You can use dual-layer server-side encryption with AWS KMS keys (DSSE-KMS) by specifying `aws:kms:dsse` for `SSEAlgorithm`. You can also use server-side encryption with S3-managed keys (SSE-S3) by modifying the [Amazon S3 Bucket ServerSideEncryptionByDefault](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-serversideencryptionbydefault.html) property to specify `AES256` for `SSEAlgorithm`. For more information, see [Using SSE-S3](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingServerSideEncryption.html) in the *Amazon S3 User Guide*.

#### JSON
<a name="aws-properties-s3-bucket-serversideencryptionbydefault--examples--Create_a_bucket_with_default_encryption--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Description": "S3 bucket with default encryption",
    "Resources": {
        "EncryptedS3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "BucketName": {
                    "Fn::Sub": "encryptedbucket-${AWS::Region}-${AWS::AccountId}"
                },
                "BucketEncryption": {
                    "ServerSideEncryptionConfiguration": [
                        {
                            "ServerSideEncryptionByDefault": {
                                "SSEAlgorithm": "aws:kms",
                                "KMSMasterKeyID": "KMS-KEY-ARN"
                            }
                        }
                    ]
                }
            },
            "DeletionPolicy": "Delete"
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-serversideencryptionbydefault--examples--Create_a_bucket_with_default_encryption--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Description: S3 bucket with default encryption
Resources:
  EncryptedS3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      BucketName: !Sub 'encryptedbucket-${AWS::Region}-${AWS::AccountId}'
      BucketEncryption:
        ServerSideEncryptionConfiguration:
          - ServerSideEncryptionByDefault:
              SSEAlgorithm: 'aws:kms'
              KMSMasterKeyID: KMS-KEY-ARN
    DeletionPolicy: Delete
```

# AWS::S3::Bucket ServerSideEncryptionRule
<a name="aws-properties-s3-bucket-serversideencryptionrule"></a>

Specifies the default server-side encryption configuration.

**Note**  
**General purpose buckets** - If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then AWS KMS resolves the key within the requester’s account. This behavior can result in data that's encrypted with a KMS key that belongs to the requester, and not the bucket owner.
**Directory buckets** - When you specify an [AWS KMS customer managed key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) for encryption in your directory bucket, only use the key ID or key ARN. The key alias format of the KMS key isn't supported.

## Syntax
<a name="aws-properties-s3-bucket-serversideencryptionrule-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-serversideencryptionrule-syntax.json"></a>

```
{
  "[BlockedEncryptionTypes](#cfn-s3-bucket-serversideencryptionrule-blockedencryptiontypes)" : BlockedEncryptionTypes,
  "[BucketKeyEnabled](#cfn-s3-bucket-serversideencryptionrule-bucketkeyenabled)" : Boolean,
  "[ServerSideEncryptionByDefault](#cfn-s3-bucket-serversideencryptionrule-serversideencryptionbydefault)" : ServerSideEncryptionByDefault
}
```

### YAML
<a name="aws-properties-s3-bucket-serversideencryptionrule-syntax.yaml"></a>

```
  [BlockedEncryptionTypes](#cfn-s3-bucket-serversideencryptionrule-blockedencryptiontypes): 
    BlockedEncryptionTypes
  [BucketKeyEnabled](#cfn-s3-bucket-serversideencryptionrule-bucketkeyenabled): Boolean
  [ServerSideEncryptionByDefault](#cfn-s3-bucket-serversideencryptionrule-serversideencryptionbydefault): 
    ServerSideEncryptionByDefault
```

## Properties
<a name="aws-properties-s3-bucket-serversideencryptionrule-properties"></a>

`BlockedEncryptionTypes`  <a name="cfn-s3-bucket-serversideencryptionrule-blockedencryptiontypes"></a>
A bucket-level setting for Amazon S3 general purpose buckets used to prevent the upload of new objects encrypted with the specified server-side encryption type. For example, blocking an encryption type will block `PutObject`, `CopyObject`, `PostObject`, multipart upload, and replication requests to the bucket for objects with the specified encryption type. However, you can continue to read and list any pre-existing objects already encrypted with the specified encryption type. For more information, see [Blocking or unblocking SSE-C for a general purpose bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/blocking-unblocking-s3-c-encryption-gpb.html).  
Currently, this parameter only supports blocking or unblocking server-side encryption with customer-provided keys (SSE-C). For more information about SSE-C, see [Using server-side encryption with customer-provided keys (SSE-C)](https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html).
*Required*: No  
*Type*: [BlockedEncryptionTypes](aws-properties-s3-bucket-blockedencryptiontypes.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`BucketKeyEnabled`  <a name="cfn-s3-bucket-serversideencryptionrule-bucketkeyenabled"></a>
Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting the `BucketKeyEnabled` element to `true` causes Amazon S3 to use an S3 Bucket Key. By default, S3 Bucket Key is not enabled.  
For more information, see [Amazon S3 Bucket Keys](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) in the *Amazon S3 User Guide*.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ServerSideEncryptionByDefault`  <a name="cfn-s3-bucket-serversideencryptionrule-serversideencryptionbydefault"></a>
Specifies the default server-side encryption to apply to new objects in the bucket. If a PUT Object request doesn't specify any server-side encryption, this default encryption will be applied.  
*Required*: No  
*Type*: [ServerSideEncryptionByDefault](aws-properties-s3-bucket-serversideencryptionbydefault.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-serversideencryptionrule--examples"></a>

**Topics**
+ [Create a bucket with default encryption](#aws-properties-s3-bucket-serversideencryptionrule--examples--Create_a_bucket_with_default_encryption)
+ [Create a bucket using KMS server-side encryption with an S3 Bucket Key](#aws-properties-s3-bucket-serversideencryptionrule--examples--Create_a_bucket_using_KMS_server-side_encryption_with_an_S3_Bucket_Key)

### Create a bucket with default encryption
<a name="aws-properties-s3-bucket-serversideencryptionrule--examples--Create_a_bucket_with_default_encryption"></a>

The following example creates a bucket with server-side bucket encryption configured. This example uses encryption with KMS keys (SSE-KMS). You can use dual-layer server-side encryption with AWS KMS keys (DSSE-KMS) by specifying `aws:kms:dsse` for `SSEAlgorithm`. You can also use server-side encryption with S3-managed keys (SSE-S3) by modifying the [Amazon S3 Bucket ServerSideEncryptionByDefault](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-serversideencryptionbydefault.html) property to specify `AES256` for `SSEAlgorithm`. For more information, see [Using SSE-S3](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingServerSideEncryption.html) in the *Amazon S3 User Guide*.

#### JSON
<a name="aws-properties-s3-bucket-serversideencryptionrule--examples--Create_a_bucket_with_default_encryption--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Description": "S3 bucket with default encryption",
    "Resources": {
        "EncryptedS3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "BucketName": {
                    "Fn::Sub": "encryptedbucket-${AWS::Region}-${AWS::AccountId}"
                },
                "BucketEncryption": {
                    "ServerSideEncryptionConfiguration": [
                        {
                            "ServerSideEncryptionByDefault": {
                                "SSEAlgorithm": "aws:kms",
                                "KMSMasterKeyID": "KMS-KEY-ARN"
                            }
                        }
                    ]
                }
            },
            "DeletionPolicy": "Delete"
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-serversideencryptionrule--examples--Create_a_bucket_with_default_encryption--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Description: S3 bucket with default encryption
Resources:
  EncryptedS3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      BucketName: !Sub 'encryptedbucket-${AWS::Region}-${AWS::AccountId}'
      BucketEncryption:
        ServerSideEncryptionConfiguration:
          - ServerSideEncryptionByDefault:
              SSEAlgorithm: 'aws:kms'
              KMSMasterKeyID: KMS-KEY-ARN
    DeletionPolicy: Delete
```

### Create a bucket using KMS server-side encryption with an S3 Bucket Key
<a name="aws-properties-s3-bucket-serversideencryptionrule--examples--Create_a_bucket_using_KMS_server-side_encryption_with_an_S3_Bucket_Key"></a>

The following example creates a bucket that specifies default encryption using AWS KMS server-side encryption with an S3 Bucket Key. The example uses a customer managed AWS KMS key.

#### JSON
<a name="aws-properties-s3-bucket-serversideencryptionrule--examples--Create_a_bucket_using_KMS_server-side_encryption_with_an_S3_Bucket_Key--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Description": "S3 bucket with default encryption using SSE-KMS with an S3 Bucket Key",
    "Resources": {
        "EncryptedS3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "BucketName": {
                    "Fn::Sub": "encryptedbucket-${AWS::Region}-${AWS::AccountId}"
                },
                "BucketEncryption": {
                    "ServerSideEncryptionConfiguration": [
                        {
                            "ServerSideEncryptionByDefault": {
                                "SSEAlgorithm": "aws:kms",
                                "KMSMasterKeyID": "KMS-KEY-ARN"
                            },
                            "BucketKeyEnabled": true
                        }
                    ]
                }
            },
            "DeletionPolicy": "Delete"
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-serversideencryptionrule--examples--Create_a_bucket_using_KMS_server-side_encryption_with_an_S3_Bucket_Key--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Description: S3 bucket with default encryption using SSE-KMS with an S3 Bucket Key
Resources:
  EncryptedS3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      BucketName: !Sub 'encryptedbucket-${AWS::Region}-${AWS::AccountId}'
      BucketEncryption:
        ServerSideEncryptionConfiguration:
          - ServerSideEncryptionByDefault:
              SSEAlgorithm: 'aws:kms'
              KMSMasterKeyID: KMS-KEY-ARN
            BucketKeyEnabled: true
    DeletionPolicy: Delete
```

# AWS::S3::Bucket SourceSelectionCriteria
<a name="aws-properties-s3-bucket-sourceselectioncriteria"></a>

A container that describes additional filters for identifying the source objects that you want to replicate. You can choose to enable or disable the replication of these objects.

## Syntax
<a name="aws-properties-s3-bucket-sourceselectioncriteria-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-sourceselectioncriteria-syntax.json"></a>

```
{
  "[ReplicaModifications](#cfn-s3-bucket-sourceselectioncriteria-replicamodifications)" : ReplicaModifications,
  "[SseKmsEncryptedObjects](#cfn-s3-bucket-sourceselectioncriteria-ssekmsencryptedobjects)" : SseKmsEncryptedObjects
}
```

### YAML
<a name="aws-properties-s3-bucket-sourceselectioncriteria-syntax.yaml"></a>

```
  [ReplicaModifications](#cfn-s3-bucket-sourceselectioncriteria-replicamodifications): 
    ReplicaModifications
  [SseKmsEncryptedObjects](#cfn-s3-bucket-sourceselectioncriteria-ssekmsencryptedobjects): 
    SseKmsEncryptedObjects
```

## Properties
<a name="aws-properties-s3-bucket-sourceselectioncriteria-properties"></a>

`ReplicaModifications`  <a name="cfn-s3-bucket-sourceselectioncriteria-replicamodifications"></a>
A filter that you can specify for selection for modifications on replicas.   
*Required*: No  
*Type*: [ReplicaModifications](aws-properties-s3-bucket-replicamodifications.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SseKmsEncryptedObjects`  <a name="cfn-s3-bucket-sourceselectioncriteria-ssekmsencryptedobjects"></a>
 A container for filter information for the selection of Amazon S3 objects encrypted with AWS KMS.  
*Required*: No  
*Type*: [SseKmsEncryptedObjects](aws-properties-s3-bucket-ssekmsencryptedobjects.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket SseKmsEncryptedObjects
<a name="aws-properties-s3-bucket-ssekmsencryptedobjects"></a>

A container for filter information for the selection of S3 objects encrypted with AWS KMS.

## Syntax
<a name="aws-properties-s3-bucket-ssekmsencryptedobjects-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-ssekmsencryptedobjects-syntax.json"></a>

```
{
  "[Status](#cfn-s3-bucket-ssekmsencryptedobjects-status)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-ssekmsencryptedobjects-syntax.yaml"></a>

```
  [Status](#cfn-s3-bucket-ssekmsencryptedobjects-status): String
```

## Properties
<a name="aws-properties-s3-bucket-ssekmsencryptedobjects-properties"></a>

`Status`  <a name="cfn-s3-bucket-ssekmsencryptedobjects-status"></a>
Specifies whether Amazon S3 replicates objects created with server-side encryption using an AWS KMS key stored in AWS Key Management Service.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `Disabled | Enabled`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket StorageClassAnalysis
<a name="aws-properties-s3-bucket-storageclassanalysis"></a>

Specifies data related to access patterns to be collected and made available to analyze the tradeoffs between different storage classes for an Amazon S3 bucket.

## Syntax
<a name="aws-properties-s3-bucket-storageclassanalysis-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-storageclassanalysis-syntax.json"></a>

```
{
  "[DataExport](#cfn-s3-bucket-storageclassanalysis-dataexport)" : DataExport
}
```

### YAML
<a name="aws-properties-s3-bucket-storageclassanalysis-syntax.yaml"></a>

```
  [DataExport](#cfn-s3-bucket-storageclassanalysis-dataexport): 
    DataExport
```

## Properties
<a name="aws-properties-s3-bucket-storageclassanalysis-properties"></a>

`DataExport`  <a name="cfn-s3-bucket-storageclassanalysis-dataexport"></a>
Specifies how data related to the storage class analysis for an Amazon S3 bucket should be exported.  
*Required*: No  
*Type*: [DataExport](aws-properties-s3-bucket-dataexport.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## See also
<a name="aws-properties-s3-bucket-storageclassanalysis--seealso"></a>
+ AWS::S3::Bucket [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#aws-properties-s3-bucket--examples)



# AWS::S3::Bucket Tag
<a name="aws-properties-s3-bucket-tag"></a>

A container of a key value name pair.

## Syntax
<a name="aws-properties-s3-bucket-tag-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-tag-syntax.json"></a>

```
{
  "[Key](#cfn-s3-bucket-tag-key)" : String,
  "[Value](#cfn-s3-bucket-tag-value)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-tag-syntax.yaml"></a>

```
  [Key](#cfn-s3-bucket-tag-key): String
  [Value](#cfn-s3-bucket-tag-value): String
```

## Properties
<a name="aws-properties-s3-bucket-tag-properties"></a>

`Key`  <a name="cfn-s3-bucket-tag-key"></a>
Name of the object key.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-s3-bucket-tag-value"></a>
Value of the tag.  
*Required*: Yes  
*Type*: String  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket TagFilter
<a name="aws-properties-s3-bucket-tagfilter"></a>

Specifies tags to use to identify a subset of objects for an Amazon S3 bucket. For more information, see [Categorizing your storage using tags](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html) in the *Amazon Simple Storage Service User Guide*.

## Syntax
<a name="aws-properties-s3-bucket-tagfilter-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-tagfilter-syntax.json"></a>

```
{
  "[Key](#cfn-s3-bucket-tagfilter-key)" : String,
  "[Value](#cfn-s3-bucket-tagfilter-value)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-tagfilter-syntax.yaml"></a>

```
  [Key](#cfn-s3-bucket-tagfilter-key): String
  [Value](#cfn-s3-bucket-tagfilter-value): String
```

## Properties
<a name="aws-properties-s3-bucket-tagfilter-properties"></a>

`Key`  <a name="cfn-s3-bucket-tagfilter-key"></a>
The tag key.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-s3-bucket-tagfilter-value"></a>
The tag value.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## See also
<a name="aws-properties-s3-bucket-tagfilter--seealso"></a>
+ AWS::S3::Bucket [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#aws-properties-s3-bucket--examples)



# AWS::S3::Bucket TargetObjectKeyFormat
<a name="aws-properties-s3-bucket-targetobjectkeyformat"></a>

Amazon S3 key format for log objects. Only one format, PartitionedPrefix or SimplePrefix, is allowed.

## Syntax
<a name="aws-properties-s3-bucket-targetobjectkeyformat-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-targetobjectkeyformat-syntax.json"></a>

```
{
  "[PartitionedPrefix](#cfn-s3-bucket-targetobjectkeyformat-partitionedprefix)" : PartitionedPrefix,
  "[SimplePrefix](#cfn-s3-bucket-targetobjectkeyformat-simpleprefix)" : Json
}
```

### YAML
<a name="aws-properties-s3-bucket-targetobjectkeyformat-syntax.yaml"></a>

```
  [PartitionedPrefix](#cfn-s3-bucket-targetobjectkeyformat-partitionedprefix): 
    PartitionedPrefix
  [SimplePrefix](#cfn-s3-bucket-targetobjectkeyformat-simpleprefix): Json
```

## Properties
<a name="aws-properties-s3-bucket-targetobjectkeyformat-properties"></a>

`PartitionedPrefix`  <a name="cfn-s3-bucket-targetobjectkeyformat-partitionedprefix"></a>
Partitioned S3 key for log objects.  
*Required*: No  
*Type*: [PartitionedPrefix](aws-properties-s3-bucket-partitionedprefix.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SimplePrefix`  <a name="cfn-s3-bucket-targetobjectkeyformat-simpleprefix"></a>
To use the simple format for S3 keys for log objects. To specify SimplePrefix format, set SimplePrefix to \$1\$1.  
*Required*: No  
*Type*: Json  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket Tiering
<a name="aws-properties-s3-bucket-tiering"></a>

The S3 Intelligent-Tiering storage class is designed to optimize storage costs by automatically moving data to the most cost-effective storage access tier, without additional operational overhead.

## Syntax
<a name="aws-properties-s3-bucket-tiering-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-tiering-syntax.json"></a>

```
{
  "[AccessTier](#cfn-s3-bucket-tiering-accesstier)" : String,
  "[Days](#cfn-s3-bucket-tiering-days)" : Integer
}
```

### YAML
<a name="aws-properties-s3-bucket-tiering-syntax.yaml"></a>

```
  [AccessTier](#cfn-s3-bucket-tiering-accesstier): String
  [Days](#cfn-s3-bucket-tiering-days): Integer
```

## Properties
<a name="aws-properties-s3-bucket-tiering-properties"></a>

`AccessTier`  <a name="cfn-s3-bucket-tiering-accesstier"></a>
S3 Intelligent-Tiering access tier. See [Storage class for automatically optimizing frequently and infrequently accessed objects](https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access) for a list of access tiers in the S3 Intelligent-Tiering storage class.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `ARCHIVE_ACCESS | DEEP_ARCHIVE_ACCESS`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Days`  <a name="cfn-s3-bucket-tiering-days"></a>
The number of consecutive days of no access after which an object will be eligible to be transitioned to the corresponding tier. The minimum number of days specified for Archive Access tier must be at least 90 days and Deep Archive Access tier must be at least 180 days. The maximum can be up to 2 years (730 days).  
*Required*: Yes  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::S3::Bucket TopicConfiguration
<a name="aws-properties-s3-bucket-topicconfiguration"></a>

A container for specifying the configuration for publication of messages to an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects specified events.

## Syntax
<a name="aws-properties-s3-bucket-topicconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-topicconfiguration-syntax.json"></a>

```
{
  "[Event](#cfn-s3-bucket-topicconfiguration-event)" : String,
  "[Filter](#cfn-s3-bucket-topicconfiguration-filter)" : NotificationFilter,
  "[Topic](#cfn-s3-bucket-topicconfiguration-topic)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-topicconfiguration-syntax.yaml"></a>

```
  [Event](#cfn-s3-bucket-topicconfiguration-event): String
  [Filter](#cfn-s3-bucket-topicconfiguration-filter): 
    NotificationFilter
  [Topic](#cfn-s3-bucket-topicconfiguration-topic): String
```

## Properties
<a name="aws-properties-s3-bucket-topicconfiguration-properties"></a>

`Event`  <a name="cfn-s3-bucket-topicconfiguration-event"></a>
The Amazon S3 bucket event about which to send notifications. For more information, see [Supported Event Types](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) in the *Amazon S3 User Guide*.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Filter`  <a name="cfn-s3-bucket-topicconfiguration-filter"></a>
The filtering rules that determine for which objects to send notifications. For example, you can create a filter so that Amazon S3 sends notifications only when image files with a `.jpg` extension are added to the bucket.  
*Required*: No  
*Type*: [NotificationFilter](aws-properties-s3-bucket-notificationfilter.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Topic`  <a name="cfn-s3-bucket-topicconfiguration-topic"></a>
The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 publishes a message when it detects events of the specified type.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-topicconfiguration--examples"></a>



### Receive S3 bucket notifications to an SNS topic
<a name="aws-properties-s3-bucket-topicconfiguration--examples--Receive_S3_bucket_notifications_to_an_SNS_topic"></a>

The following example template shows an Amazon S3 bucket with a notification configuration that sends an event to the specified SNS topic when S3 has lost all replicas of an object.

#### JSON
<a name="aws-properties-s3-bucket-topicconfiguration--examples--Receive_S3_bucket_notifications_to_an_SNS_topic--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "AccessControl": "Private",
                "NotificationConfiguration": {
                    "TopicConfigurations": [
                        {
                            "Topic": "arn:aws:sns:us-east-1:123456789012:TestTopic",
                            "Event": "s3:ReducedRedundancyLostObject"
                        }
                    ]
                }
            }
        }
    },
    "Outputs": {
        "BucketName": {
            "Value": {
                "Ref": "S3Bucket"
            },
            "Description": "Name of the sample Amazon S3 bucket with a notification configuration."
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-topicconfiguration--examples--Receive_S3_bucket_notifications_to_an_SNS_topic--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      AccessControl: Private
      NotificationConfiguration:
        TopicConfigurations:
          - Topic: 'arn:aws:sns:us-east-1:123456789012:TestTopic'
            Event: 's3:ReducedRedundancyLostObject'
Outputs:
  BucketName:
    Value: !Ref S3Bucket
    Description: Name of the sample Amazon S3 bucket with a notification configuration.
```

# AWS::S3::Bucket Transition
<a name="aws-properties-s3-bucket-transition"></a>

Specifies when an object transitions to a specified storage class. For more information about Amazon S3 lifecycle configuration rules, see [Transitioning Objects Using Amazon S3 Lifecycle](https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html) in the *Amazon S3 User Guide*.

## Syntax
<a name="aws-properties-s3-bucket-transition-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-transition-syntax.json"></a>

```
{
  "[StorageClass](#cfn-s3-bucket-transition-storageclass)" : String,
  "[TransitionDate](#cfn-s3-bucket-transition-transitiondate)" : String,
  "[TransitionInDays](#cfn-s3-bucket-transition-transitionindays)" : Integer
}
```

### YAML
<a name="aws-properties-s3-bucket-transition-syntax.yaml"></a>

```
  [StorageClass](#cfn-s3-bucket-transition-storageclass): String
  [TransitionDate](#cfn-s3-bucket-transition-transitiondate): String
  [TransitionInDays](#cfn-s3-bucket-transition-transitionindays): Integer
```

## Properties
<a name="aws-properties-s3-bucket-transition-properties"></a>

`StorageClass`  <a name="cfn-s3-bucket-transition-storageclass"></a>
The storage class to which you want the object to transition.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `DEEP_ARCHIVE | GLACIER | Glacier | GLACIER_IR | INTELLIGENT_TIERING | ONEZONE_IA | STANDARD_IA`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TransitionDate`  <a name="cfn-s3-bucket-transition-transitiondate"></a>
Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 format. The time is always midnight UTC.  
*Required*: Conditional  
*Type*: String  
*Pattern*: `^(\d{4})-(0[0-9]|1[0-2])-([0-2]\d|3[01])T([01]\d|2[0-4]):([0-5]\d):([0-6]\d)((\.\d{3})?)Z$`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TransitionInDays`  <a name="cfn-s3-bucket-transition-transitionindays"></a>
Indicates the number of days after creation when objects are transitioned to the specified storage class. If the specified storage class is `INTELLIGENT_TIERING`, `GLACIER_IR`, `GLACIER`, or `DEEP_ARCHIVE`, valid values are `0` or positive integers. If the specified storage class is `STANDARD_IA` or `ONEZONE_IA`, valid values are positive integers greater than `30`. Be aware that some storage classes have a minimum storage duration and that you're charged for transitioning objects before their minimum storage duration. For more information, see [ Constraints and considerations for transitions](https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-transition-general-considerations.html#lifecycle-configuration-constraints) in the *Amazon S3 User Guide*.  
*Required*: Conditional  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## See also
<a name="aws-properties-s3-bucket-transition--seealso"></a>
+ AWS::S3::Bucket [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#aws-properties-s3-bucket--examples)



# AWS::S3::Bucket VersioningConfiguration
<a name="aws-properties-s3-bucket-versioningconfiguration"></a>

Describes the versioning state of an Amazon S3 bucket. For more information, see [PUT Bucket versioning](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html) in the *Amazon S3 API Reference*.

Keep the following timing in mind when enabling, suspending, or transitioning between versioning states:
+ **Enabling versioning** - Changes may take up to 15 minutes to propagate across all AWS regions for full consistency.
+ **Suspending versioning** - Takes effect immediately with no propagation delay.
+ **Transitioning between states** - Any change from Suspended to Enabled has a 15-minute delay.

## Syntax
<a name="aws-properties-s3-bucket-versioningconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-versioningconfiguration-syntax.json"></a>

```
{
  "[Status](#cfn-s3-bucket-versioningconfiguration-status)" : String
}
```

### YAML
<a name="aws-properties-s3-bucket-versioningconfiguration-syntax.yaml"></a>

```
  [Status](#cfn-s3-bucket-versioningconfiguration-status): String
```

## Properties
<a name="aws-properties-s3-bucket-versioningconfiguration-properties"></a>

`Status`  <a name="cfn-s3-bucket-versioningconfiguration-status"></a>
The versioning state of the bucket.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `Enabled | Suspended`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

## Examples
<a name="aws-properties-s3-bucket-versioningconfiguration--examples"></a>



### Enable versioning and replicate objects
<a name="aws-properties-s3-bucket-versioningconfiguration--examples--Enable_versioning_and_replicate_objects"></a>

The following example enables versioning and two replication rules. The rules copy objects prefixed with either `MyPrefix` and `MyOtherPrefix` and stores the copied objects in a bucket named `my-replication-bucket`.

#### JSON
<a name="aws-properties-s3-bucket-versioningconfiguration--examples--Enable_versioning_and_replicate_objects--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "VersioningConfiguration": {
                    "Status": "Enabled"
                },
                "ReplicationConfiguration": {
                    "Role": "arn:aws:iam::123456789012:role/replication_role",
                    "Rules": [
                        {
                            "Id": "MyRule1",
                            "Status": "Enabled",
                            "Prefix": "MyPrefix",
                            "Destination": {
                                "Bucket": "arn:aws:s3:::my-replication-bucket",
                                "StorageClass": "STANDARD"
                            }
                        },
                        {
                            "Status": "Enabled",
                            "Prefix": "MyOtherPrefix",
                            "Destination": {
                                "Bucket": "arn:aws:s3:::my-replication-bucket"
                            }
                        }
                    ]
                }
            }
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-versioningconfiguration--examples--Enable_versioning_and_replicate_objects--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      VersioningConfiguration:
        Status: Enabled
      ReplicationConfiguration:
        Role: 'arn:aws:iam::123456789012:role/replication_role'
        Rules:
          - Id: MyRule1
            Status: Enabled
            Prefix: MyPrefix
            Destination:
              Bucket: 'arn:aws:s3:::my-replication-bucket'
              StorageClass: STANDARD
          - Status: Enabled
            Prefix: MyOtherPrefix
            Destination:
              Bucket: 'arn:aws:s3:::my-replication-bucket'
```

# AWS::S3::Bucket WebsiteConfiguration
<a name="aws-properties-s3-bucket-websiteconfiguration"></a>

Specifies website configuration parameters for an Amazon S3 bucket.

## Syntax
<a name="aws-properties-s3-bucket-websiteconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-s3-bucket-websiteconfiguration-syntax.json"></a>

```
{
  "[ErrorDocument](#cfn-s3-bucket-websiteconfiguration-errordocument)" : String,
  "[IndexDocument](#cfn-s3-bucket-websiteconfiguration-indexdocument)" : String,
  "[RedirectAllRequestsTo](#cfn-s3-bucket-websiteconfiguration-redirectallrequeststo)" : RedirectAllRequestsTo,
  "[RoutingRules](#cfn-s3-bucket-websiteconfiguration-routingrules)" : [ RoutingRule, ... ]
}
```

### YAML
<a name="aws-properties-s3-bucket-websiteconfiguration-syntax.yaml"></a>

```
  [ErrorDocument](#cfn-s3-bucket-websiteconfiguration-errordocument): String
  [IndexDocument](#cfn-s3-bucket-websiteconfiguration-indexdocument): String
  [RedirectAllRequestsTo](#cfn-s3-bucket-websiteconfiguration-redirectallrequeststo): 
    RedirectAllRequestsTo
  [RoutingRules](#cfn-s3-bucket-websiteconfiguration-routingrules): 
    - RoutingRule
```

## Properties
<a name="aws-properties-s3-bucket-websiteconfiguration-properties"></a>

`ErrorDocument`  <a name="cfn-s3-bucket-websiteconfiguration-errordocument"></a>
The name of the error document for the website.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`IndexDocument`  <a name="cfn-s3-bucket-websiteconfiguration-indexdocument"></a>
The name of the index document for the website.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RedirectAllRequestsTo`  <a name="cfn-s3-bucket-websiteconfiguration-redirectallrequeststo"></a>
The redirect behavior for every request to this bucket's website endpoint.  
If you specify this property, you can't specify any other property.
*Required*: No  
*Type*: [RedirectAllRequestsTo](aws-properties-s3-bucket-redirectallrequeststo.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RoutingRules`  <a name="cfn-s3-bucket-websiteconfiguration-routingrules"></a>
Rules that define when a redirect is applied and the redirect behavior.  
*Required*: No  
*Type*: Array of [RoutingRule](aws-properties-s3-bucket-routingrule.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-s3-bucket-websiteconfiguration--examples"></a>



### Configure a static website with a routing rule
<a name="aws-properties-s3-bucket-websiteconfiguration--examples--Configure_a_static_website_with_a_routing_rule"></a>

In this example, `AWS::S3::Bucket's Fn::GetAtt` values are used to provide outputs. If an HTTP 404 error occurs, the routing rule redirects requests to an EC2 instance and inserts the object key prefix `report-404/` in the redirect. For example, if you request a page called `out1/ExamplePage.html` and it results in an HTTP 404 error, the request is routed to a page called `report-404/ExamplePage.html` on the specified instance. For all other HTTP error codes, `error.html` is returned. 

This example also specifies a metrics configuration called `EntireBucket` that enables CloudWatch request metrics at the bucket level.

#### JSON
<a name="aws-properties-s3-bucket-websiteconfiguration--examples--Configure_a_static_website_with_a_routing_rule--json"></a>

```
{
    "Resources": {
        "S3Bucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "AccessControl": "PublicRead",
                "BucketName": "public-bucket",
                "MetricsConfigurations": [
                    {
                        "Id": "EntireBucket"
                    }
                ],
                "WebsiteConfiguration": {
                    "IndexDocument": "index.html",
                    "ErrorDocument": "error.html",
                    "RoutingRules": [
                        {
                            "RoutingRuleCondition": {
                                "HttpErrorCodeReturnedEquals": "404",
                                "KeyPrefixEquals": "out1/"
                            },
                            "RedirectRule": {
                                "HostName": "ec2-11-22-333-44.compute-1.amazonaws.com",
                                "ReplaceKeyPrefixWith": "report-404/"
                            }
                        }
                    ]
                }
            },
            "DeletionPolicy": "Retain"
        }
    },
    "Outputs": {
        "WebsiteURL": {
            "Value": {
                "Fn::GetAtt": [
                    "S3Bucket",
                    "WebsiteURL"
                ]
            },
            "Description": "URL for website hosted on S3"
        },
        "S3BucketSecureURL": {
            "Value": {
                "Fn::Join": [
                    "",
                    [
                        "https://",
                        {
                            "Fn::GetAtt": [
                                "S3Bucket",
                                "DomainName"
                            ]
                        }
                    ]
                ]
            },
            "Description": "Name of S3 bucket to hold website content"
        }
    }
}
```

#### YAML
<a name="aws-properties-s3-bucket-websiteconfiguration--examples--Configure_a_static_website_with_a_routing_rule--yaml"></a>

```
Resources:
  S3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      AccessControl: PublicRead
      BucketName: public-bucket
      MetricsConfigurations:
        - Id: EntireBucket
      WebsiteConfiguration:
        IndexDocument: index.html
        ErrorDocument: error.html
        RoutingRules:
          - RoutingRuleCondition:
              HttpErrorCodeReturnedEquals: '404'
              KeyPrefixEquals: out1/
            RedirectRule:
              HostName: ec2-11-22-333-44.compute-1.amazonaws.com
              ReplaceKeyPrefixWith: report-404/
    DeletionPolicy: Retain
Outputs:
  WebsiteURL:
    Value: !GetAtt
      - S3Bucket
      - WebsiteURL
    Description: URL for website hosted on S3
  S3BucketSecureURL:
    Value: !Join
      - ''
      - - 'https://'
        - !GetAtt
          - S3Bucket
          - DomainName
    Description: Name of S3 bucket to hold website content
```