Why isn't the lifecycle rule on my Amazon S3 bucket working even though I applied it more than one day ago?
Last updated: 2022-11-22
I set a lifecycle configuration rule on my Amazon Simple Storage Service (Amazon S3) bucket to transition objects to another storage class or expire objects. However, the objects haven't changed according to the rule. Why is this happening?
There might be a delay between when the lifecycle rule is satisfied and when the action for the rule is complete. Changes in billing are applied when the lifecycle rule is satisfied, even if the action isn't complete.
Examples of this include:
- If you have a lifecycle rule for object expiration, then you aren't charged for storage after the expiration time, even if the object isn't expired immediately.
- A lifecycle rule to transition objects to the GLACIER storage class charges the Amazon S3 Glacier storage rates when the object transition time elapses. This occurs even if the object isn't immediately transitioned to the GLACIER storage class.
Note: If you set a lifecycle transition to the INTELLIGENT_TIERING storage class, then changes in billing don't happen until the object transitions to the INTELLIGENT_TIERING storage class. This is the exception.
Additionally, Amazon S3 rounds the transition or expiration date of an object to midnight UTC the next day. For example, consider an object created on 1/1/2020 10:30 UTC, with a lifecycle rule to transition the object after 3 days. For this object, the transition date is 1/5/2020 00:00 UTC. Before you check whether a lifecycle rule is satisfied, be sure to verify that enough time has elapsed.
If enough time has elapsed and your lifecycle rule isn't satisfied, verify that the prefix filter for the objects is set correctly on the lifecycle rule. Examples include:
- If there's no prefix filter specified in the lifecycle rule, then the rule is applied to all objects in the bucket.
- If you specify a prefix filter as images/, then the lifecycle rule is applied to all objects under the prefix images/.
Note: Be sure that the / character is specified at the end of the prefix filter. The lifecycle rule won't be evaluated correctly if the / character is at the beginning of the prefix filter.