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
- 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
- Expiration Actions
– Permanently delete objects after a defined time.
- Useful for data retention policies.
- Noncurrent Version Actions – Manage versioned objects (e.g., delete older
versions after X days).
- 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