S3 Lifecycle Policies allow you to manage your objects so that they are stored cost-effectively throughout their lifecycle. You can define rules to:
- Transition objects to another storage class (e.g., from S3 Standard to S3 Standard-IA).
- Expire objects by deleting them after a specified period.
- Archive older versions of objects to Glacier.
- Remove incomplete multipart uploads.
Example of a lifecycle policy to transition objects to S3 Glacier after 30 days and delete after 365 days:
{
"Rules": [
{
"ID": "TransitionToGlacierAndExpire",
"Prefix": "",
"Status": "Enabled",
"Transitions": [
{
"Days": 30,
"StorageClass": "GLACIER"
}
],
"Expiration": {
"Days": 365
}
}
]
}