7 min read

S3 Lifecycle Policies That Actually Save Money

Standard → IA → Glacier transitions, the traps in transition timing, and a real before/after bill from a production bucket.

D
Dev  ·  Senior DevOps & SRE Engineer  ·  ap-south-1
Subscribed — full post unlocked

S3 Lifecycle Policies are rules attached to a bucket (or a prefix within it) that automatically transition objects between storage classes, or delete them, based on age. Nobody reads the documentation until the bill shows up — so let's start with the bill.

The bucket that triggered this post

A production bucket storing application logs and uploaded report PDFs had grown to roughly 400GB, almost entirely in S3 Standard, because no lifecycle rule existed. Every object — including a two-year-old log file nobody had read since the week it was created — was being billed at the same per-GB rate as the file uploaded ten minutes ago.

Continue reading

Unlock the full transition rules, the exact cost comparison, and the timing trap that costs people money.

No spam. One confirmation email via SES. Unsubscribe anytime.

The storage classes, in the order data should move through them

S3 Standard

The default class. Designed for frequently accessed data, millisecond first-byte latency, and the highest per-GB storage price of the "always available" tiers. This is where every object lands the moment it's uploaded, unless you explicitly choose otherwise.

S3 Standard-IA (Infrequent Access)

Same millisecond retrieval speed as Standard, same 11-nines durability, but roughly 40-45% cheaper per GB to store. The trade-off: you're charged a per-GB retrieval fee every time you actually read the object, and there's a 30-day minimum storage duration — moving an object out before 30 days still bills you for the full 30 days.

S3 Glacier Instant Retrieval

Archive-tier pricing with millisecond retrieval still intact. Good middle ground for data that's rarely accessed but, when it is needed, needs to come back immediately (compliance documents someone might urgently request).

S3 Glacier Flexible Retrieval

Cheaper again, but retrieval now takes minutes to hours depending on the retrieval tier you choose (Expedited, Standard, Bulk). This is true archival — you're trading retrieval speed for a much lower storage cost, intentionally.

S3 Glacier Deep Archive

The cheapest storage class S3 offers. Retrieval takes 12+ hours. This is for data you are legally or operationally required to keep but realistically expect to never read again — multi-year compliance retention, for example.

The lifecycle rule that fixed the bucket

The rule applied looked like this, conceptually:

Rule: log-and-report-aging
Prefix: logs/
  - Day 0-30:   S3 Standard          (active investigation window)
  - Day 30:     transition to Standard-IA
  - Day 90:     transition to Glacier Flexible Retrieval
  - Day 365:    transition to Glacier Deep Archive
  - Day 1825:   expire (delete) — 5 year compliance limit

This single rule, applied retroactively to existing objects and going forward to new ones, moved roughly 70% of the bucket's total data out of Standard pricing within the first 90 days after the transitions executed.

The timing trap nobody warns you about

Here's the part that actually costs people money if they don't know it going in: each storage class has a minimum storage duration, and transitioning early doesn't bypass it — you're still billed as if the object sat there the full minimum.

This means setting a lifecycle rule to transition objects to Glacier Flexible Retrieval at day 31 instead of day 90+ doesn't save money — it just means you're paying the Glacier minimum-duration charge on top of having barely used the cheaper Standard-IA tier at all. The rule has to respect each tier's minimum, or you're paying for storage tiers you're skipping past too fast to benefit from.

The before/after numbers

Rough monthly storage cost for 400GB, before any lifecycle rule, sitting entirely in S3 Standard in ap-south-1: approximately $9.2 per month for storage alone (excluding requests and transfer).

After the lifecycle rule matured (roughly 4 months in, once objects had distributed across the tiers per the schedule above): storage cost dropped to approximately $3.1 per month for the same total data volume — a reduction driven entirely by moving cold data into cheaper tiers, with zero change to the application or how data was written.

What I'd tell someone setting this up for the first time

Don't guess at the day thresholds. Pull actual S3 access patterns first — S3 Storage Lens or simple CloudTrail data event analysis will show you when objects in a given prefix actually stop being read. Set your "transition to IA" threshold right after that point, not before, or you'll trigger early-deletion charges for no benefit.

Lifecycle policies don't make your application faster or your data safer. They make the bill match what the data is actually worth to you right now — which for most production buckets is a lot less than what you're currently paying.