AWS CloudFormation
User Guide (Version )

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

AWS::S3::Bucket Rule

Specifies lifecycle rules for an Amazon S3 bucket. For more information, see PUT Bucket lifecycle in the Amazon Simple Storage Service API Reference.

Syntax

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

Properties

AbortIncompleteMultipartUpload

Specifies a lifecycle rule that aborts incomplete multipart uploads to an Amazon S3 bucket.

You must specify at least one of the following properties: AbortIncompleteMultipartUpload, ExpirationDate, ExpirationInDays, NoncurrentVersionExpirationInDays, NoncurrentVersionTransition, NoncurrentVersionTransitions, Transition, or Transitions.

Required: Conditional

Type: AbortIncompleteMultipartUpload

Update requires: No interruption

ExpirationDate

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.

You must specify at least one of the following properties: AbortIncompleteMultipartUpload, ExpirationDate, ExpirationInDays, NoncurrentVersionExpirationInDays, NoncurrentVersionTransition, NoncurrentVersionTransitions, Transition, or Transitions.

Required: Conditional

Type: Timestamp

Update requires: No interruption

ExpirationInDays

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.

You must specify at least one of the following properties: AbortIncompleteMultipartUpload, ExpirationDate, ExpirationInDays, NoncurrentVersionExpirationInDays, NoncurrentVersionTransition, NoncurrentVersionTransitions, Transition, or Transitions.

Required: Conditional

Type: Integer

Update requires: No interruption

Id

Unique identifier for the rule. The value can't be longer than 255 characters.

Required: No

Type: String

Update requires: No interruption

NoncurrentVersionExpirationInDays

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.

You must specify at least one of the following properties: AbortIncompleteMultipartUpload, ExpirationDate, ExpirationInDays, NoncurrentVersionExpirationInDays, NoncurrentVersionTransition, NoncurrentVersionTransitions, Transition, or Transitions.

Required: Conditional

Type: Integer

Update requires: No interruption

NoncurrentVersionTransition

(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.

You must specify at least one of the following properties: AbortIncompleteMultipartUpload, ExpirationDate, ExpirationInDays, NoncurrentVersionExpirationInDays, NoncurrentVersionTransition, NoncurrentVersionTransitions, Transition, or Transitions.

Required: Conditional

Type: NoncurrentVersionTransition

Update requires: No interruption

NoncurrentVersionTransitions

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.

You must specify at least one of the following properties: AbortIncompleteMultipartUpload, ExpirationDate, ExpirationInDays, NoncurrentVersionExpirationInDays, NoncurrentVersionTransition, NoncurrentVersionTransitions, Transition, or Transitions.

Required: Conditional

Type: List of NoncurrentVersionTransition

Update requires: No interruption

Prefix

Object key prefix that identifies one or more objects to which this rule applies.

Required: No

Type: String

Update requires: No interruption

Status

If Enabled, the rule is currently being applied. If Disabled, the rule is not currently being applied.

Required: Yes

Type: String

Allowed Values: Disabled | Enabled

Update requires: No interruption

TagFilters

Tags to use to identify a subset of objects to which the lifecycle rule applies.

Required: No

Type: List of TagFilter

Update requires: No interruption

Transition

(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.

You must specify at least one of the following properties: AbortIncompleteMultipartUpload, ExpirationDate, ExpirationInDays, NoncurrentVersionExpirationInDays, NoncurrentVersionTransition, NoncurrentVersionTransitions, Transition, or Transitions.

Required: Conditional

Type: Transition

Update requires: No interruption

Transitions

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.

You must specify at least one of the following properties: AbortIncompleteMultipartUpload, ExpirationDate, ExpirationInDays, NoncurrentVersionExpirationInDays, NoncurrentVersionTransition, NoncurrentVersionTransitions, Transition, or Transitions.

Required: Conditional

Type: List of Transition

Update requires: No interruption

On this page: