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

This is the new Amazon CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the Amazon CloudFormation User Guide.

AWS::S3Express::DirectoryBucket LifecycleConfiguration

Container for lifecycle rules. You can add as many as 1000 rules.

For more information see, Creating and managing a lifecycle configuration for directory buckets in the Amazon S3 User Guide.

Syntax

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

JSON

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

YAML

Rules: - Rule

Properties

Rules

A lifecycle rule for individual objects in an Amazon S3 Express bucket.

Required: Yes

Type: Array of Rule

Update requires: No interruption

Examples

Manage the lifecycle for S3 objects

The following example template shows an S3 directory bucket with a lifecycle configuration rule. The rule applies to all objects with the foo/ key prefix. The objects are expired after seven days, and incomplete multipart uploads are deleted 3 days after initiation.

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "S3ExpressBucket": { "Type": "AWS::S3Express::DirectoryBucket", "Properties": { "LocationName": "usw2-az1", "DataRedundancy": "SingleAvailabilityZone", "LifecycleConfiguration": { "Rules": [ { "Id": "ExipiryRule", "Prefix": "foo/", "Status": "Enabled", "ExpirationInDays": 7, "AbortIncompleteMultipartUpload": { "DaysAfterInitiation": 3 }, } ] } } } }, "Outputs": { "BucketName": { "Value": { "Ref": "S3ExpressBucket" }, "Description": "Name of the sample Amazon S3 Directory Bucket with a lifecycle configuration." } } }

YAML

AWSTemplateFormatVersion: 2010-09-09 Resources: S3ExpressBucket: Type: 'AWS::S3Express::DirectoryBucket' Properties: LocationName: usw2-az1 DataRedundancy: SingleAvailabilityZone LifecycleConfiguration: Rules: - Id: ExipiryRule Prefix: foo/ Status: Enabled ExpirationInDays:7 AbortIncompleteMultipartUpload: DaysAfterInitiation:3 Outputs: BucketName: Value: !Ref S3ExpressBucket Description: Name of the sample Amazon S3 Directory Bucket with a lifecycle configuration.