Use this when objects should move to cheaper tiers or expire automatically.
Lifecycle Policies
Lifecycle policies automatically move objects to cheaper storage classes or delete them after a set age, and clean up old versions and incomplete multipart uploads, keeping object storage costs under control.
1. Lifecycle policies transition (to cheaper tiers) or expire objects.
2. Expire noncurrent versions and incomplete multipart uploads.
3. Test on prefixes first.
4. Check minimum storage durations/costs.
5. Document retention.
object age/tags → rule → transition/expire
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Common mistakes Narrow the fault
- Rules that delete data still needed.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Rules act on age, prefix or tags.
- Expire old versions too.
- Clean up incomplete multipart uploads.
aws s3api get-bucket-lifecycle-configuration --bucket <b>— rulesaws s3api put-bucket-lifecycle-configuration --bucket <b> --lifecycle-configuration file://lc.json— setstorage class report— transitions
ReferenceHow it works1 section · depth on demand
Reference
aws s3api put-bucket-lifecycle-configuration --bucket b --lifecycle-configuration file://lifecycle.json
aws s3api get-bucket-lifecycle-configuration --bucket b
ReferenceImportant terms & boundaries3 sections · depth on demand
In depth
Lifecycle rules move or delete objects automatically
The AWS S3 documentation describes a lifecycle configuration as bucket-level rules that apply actions to groups of objects. There are two kinds of action. Transition moves objects to another storage class after a set time. Expiration deletes them after a set time.
$ cat lifecycle.json
{ "Rules": [
{ "ID": "logs", "Status": "Enabled", "Filter": { "Prefix": "logs/" },
"Transitions": [ { "Days": 30, "StorageClass": "STANDARD_IA" }, { "Days": 365, "StorageClass": "GLACIER" } ],
"Expiration": { "Days": 730 } },
{ "ID": "old-versions", "Status": "Enabled", "Filter": {},
"NoncurrentVersionExpiration": { "NoncurrentDays": 90 },
"AbortIncompleteMultipartUpload": { "DaysAfterInitiation": 7 } } ] }
$ aws s3api put-bucket-lifecycle-configuration --bucket app-data --lifecycle-configuration file://lifecycle.json
$ aws s3api get-bucket-lifecycle-configuration --bucket app-data
Documented behaviour to plan for
| Point | Detail |
|---|---|
| Existing objects | Rules apply to objects already in the bucket, not only to new ones |
| Timing | Not instantaneous; there can be a delay after an object becomes eligible |
| Billing | Changes when the object becomes eligible, even if the action is delayed (Intelligent-Tiering excepted) |
| Transition cost | Request charges per object transitioned |
| Minimum storage duration | Expiring early from some classes still incurs the minimum charge |
| Bucket policy | Cannot block lifecycle deletions or transitions in general purpose buckets |
Common mistakes
| Mistake | Effect |
|---|---|
| Versioned bucket without a noncurrent-version rule | Deleted and overwritten data is kept and billed forever |
| No abort rule for incomplete multipart uploads | Invisible parts accumulate cost |
| Transitioning millions of tiny objects | Request charges exceed the savings |
| Expiration shorter than backup retention | The storage deletes data the backup tool still expects |
Test a new rule on a prefix with copies of real data first. A rule applies to existing objects on its first evaluation.
Documented example, not captured output.
How it works
Lifecycle rules act on objects automatically by age, prefix or tag: transition to cheaper storage classes, expire old versions, abort incomplete multipart uploads or delete objects.
Reference
{ "Rules": [ { "ID": "expire-old", "Status": "Enabled", "Filter": { "Prefix": "logs/" },
"Transitions": [ { "Days": 30, "StorageClass": "GLACIER" } ],
"NoncurrentVersionExpiration": { "NoncurrentDays": 90 } } ] }
Documented example, not captured output.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Object Storage → Lifecycle Policies. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.snia.org/tech_activities/standards/curr_standards/cdmi · confidence 94%