lifecycle policies
- What they are
- Rules on an Amazon S3 bucket that automatically transition objects between storage classes or delete them as they age.
- Two action types
- Transition — move to a cheaper class after N days (Standard → Standard-IA → Glacier Flexible Retrieval → Glacier Deep Archive).
- Expiration — permanently delete objects, delete old versions, or clean up incomplete multipart uploads.
- Why
- Data access almost always cools with age. Paying Standard rates for three-year-old logs is pure waste.
- Automates a core Cost Optimization practice with no application changes.
- Rules to remember
- Filter by prefix, tag, or object size.
- Minimum storage durations apply (30 days before IA, 90 days for Glacier classes) — moving small, short-lived objects can cost more.
- Related but different
- S3 Intelligent-Tiering — S3 moves objects itself based on observed access, with no rules to write. Use when access patterns are unknown.
- EBS snapshot lifecycle (Data Lifecycle Manager) and ECR image lifecycle policies apply the same idea to other services.