Thursday, June 19, 2025

Amazon S3 Lifecycle Rules | Overview.

Amazon S3  Lifecycle Rules - Overview.

Scope:

  • Intro,
  • Architecture,
  • Common Use Cases,
  • Key Lifecycle Actions,
  • Sample Lifecycle Rule(Policy),
  • insights.

Intro:

  • Amazon S3 Lifecycle rules allow twtech to automate the transition of objects between storage classes and manage object expiration to reduce costs and improve efficiency.

Architecture:


Common Use Cases

  • Move infrequently accessed data to lower-cost storage (e.g., from S3 Standard to S3 Glacier).
  • Expire/delete old data automatically (e.g., delete logs after 365 days).
  • Manage multipart upload cleanup.

 Key Lifecycle Actions

  1. Transition ActionsChange the storage class of an object.
    • E.g., Move to:
      • S3 Standard-IA (Infrequent Access)
      • S3 One Zone-IA
      • S3 Glacier
      • S3 Glacier Deep Archive
  2. Expiration ActionsPermanently delete objects after a defined time.
    • Useful for data retention policies.
  3. Noncurrent Version Actions – Manage versioned objects (e.g., delete older versions after X days).
  4. Incomplete Multipart UploadsAutomatically clean up uploads that were never completed.

twtech Sample Lifecycle Rule

Transition objects to S3 Glacier after 60 days and delete them after 365 days.

# json

{

  "Rules": [

    {

      "ID": "MoveToGlacierAndExpire",

      "Status": "Enabled",

      "Prefix": "",

      "Transitions": [

        {

          "Days": 60,

          "StorageClass": "GLACIER"

        }

      ],

      "Expiration": {

        "Days": 365

      }

    }

  ]

}

 twtech-insights:

  • Rules can apply to all objects or be filtered by prefix or object tags.
  • Lifecycle policies auto-work in the background—transitions and deletions are not immediate but generally happen within a day.


No comments:

Post a Comment

Amazon EventBridge | Overview.

Amazon EventBridge - Overview. Scope: Intro, Core Concepts, Key Benefits, Link to official documentation, Insights. Intro: Amazon EventBridg...