Interview Prep/AWS/Storage and Databases

How do S3 lifecycle rules work?

IntermediateConceptStorage and Databases
Answer

A rule filters by prefix, tag or size and applies actions: transition to another class after N days, expire current objects, expire noncurrent versions (optionally keeping the newest N), remove expired delete markers, and abort incomplete multipart uploads.

{"Rules":[{"ID":"logs","Status":"Enabled","Filter":{"Prefix":"logs/"},
 "Transitions":[{"Days":30,"StorageClass":"STANDARD_IA"},{"Days":90,"StorageClass":"GLACIER"}],
 "Expiration":{"Days":365}}]}

Minimum-duration constraints apply: transitioning to Standard-IA requires 30 days in Standard first.

aws All AWS questions Roadmap: AWS core services

More on Storage and Databases