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.