Thursday, June 19, 2025

Amazon S3 : Lifecycle Rules.

 

Amazon S3 Lifecycle Rules : Overview

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.

 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 Actions – Change 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 Actions – Permanently 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 Uploads – Automatically clean up uploads that were never completed.

twtech Example 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 work in the background—transitions and deletions are not immediate but generally happen within a day.

No comments:

Post a Comment

Kubernetes Clusters | Upstream Vs Downstream.

  The terms "upstream" and "downstream" in the context of Kubernetes clusters often refer to the direction of code fl...