ladderlore
Request a guide
  • Type a service name, like S3 or IAM.

Concept · Builds on CLF-C02

Lifecycle rules

The order, timing and filters of lifecycle rules decide how much you save and what you pay in fees.

You know from Cloud Practitioner

  • A rule moves objects to cheaper classes as they age.
  • A rule can also delete objects after a set time.
  • Rules apply to a whole bucket or to a part of it.
Read the Cloud Practitioner lesson
Standard
Standard-IA
Glacier Flexible
Deep Archive
Expire
Day 30Day 90Day 365Year 7
A typical aging path for logs.

A typical aging path for logs.

  • Transition

    What it does
    Moves objects to a colder class
    Example
    Standard-IA at 30 days
  • Expiration

    What it does
    Deletes current objects
    Example
    Delete after 7 years
  • Noncurrent versions

    What it does
    Deletes old versions
    Example
    Keep the newest 3
  • Abort uploads

    What it does
    Removes unfinished upload parts
    Example
    After 7 days
The four things a rule can do.

1 / 2

  • Transition

    What it does
    Moves objects to a colder class
    Example
    Standard-IA at 30 days
  • Expiration

    What it does
    Deletes current objects
    Example
    Delete after 7 years
  • Noncurrent versions

    What it does
    Deletes old versions
    Example
    Keep the newest 3

2 / 2

  • Abort uploads

    What it does
    Removes unfinished upload parts
    Example
    After 7 days
The four things a rule can do.

What it is

Objects move down a waterfall, from warmer to colder classes. They never move back up by a rule. Standard to Standard-IA or One Zone-IA needs at least 30 days after creation. A rule cannot move an object to Standard-IA or One Zone-IA until it is 30 days old. For other early moves, S3 allows it, but you still pay for the rest of the minimum period.

Objects under 128 KB are not moved by default, because every transition is a billed request and the saving is tiny. Add an object size filter if you want them moved.

What it is

Expiration deletes current objects. In a versioned bucket it adds a delete marker, so you also need a rule for noncurrent versions: delete them after a number of days, or keep only the newest few. Add a rule that aborts incomplete multipart uploads, because their parts bill until removed. Filter any rule by prefix, tags or size.

Remember

  • Standard to Standard-IA or One Zone-IA: at least 30 days after creation.
  • Leaving a class before its minimum period still bills the rest of it.
  • Each transition is a billed request. Skip tiny objects.
  • Versioned bucket: add a noncurrent version rule or old versions keep billing.

Remember

  • Abort incomplete multipart uploads, for example after 7 days.
  • Scope rules by prefix, tag or size, so logs and media follow different paths.

On the exam

  • “Logs are read for a month, kept for seven years, cost matters” points to a lifecycle rule that archives and later expires them.
  • “Storage keeps growing in a versioned bucket” points to a noncurrent version expiration rule.
  • “Failed large uploads still cost money” points to a rule that aborts incomplete multipart uploads.