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