Setting up S3 LifeCycles
This article gives you an easy-to-understand LifeCycle for your LEVIIA Storag3 buckets, with 3 of the most frequently used examples:
Automatically deleting expired delete markers
Managing obsolete versions of versioned objects
Cleaning up incomplete multipart uploads
Expired delete markers:
This rule automatically cleans up expired delete markers.
A delete marker is considered expired when it is the only remaining version of an object (all other versions having been deleted).
Out-of-date versions will be deleted 365 days after becoming out-of-date. In addition to the current version, the 5 most recent non-current versions will be retained, even if they exceed the 365-day period.
The values for 365 days and 5 versions can be adjusted in your JSON file to suit your needs.
Incomplete multipart uploads will be deleted 7 days after initiation. This 7-day value can be adjusted in your JSON file to suit your needs.
It's also possible to combine all these rules into a single one:
In this combined example, the lifecycle:
Deletes expired Delete Markers
Deletes out-of-date versions after 365 days, while always retaining the 5 latest versions, even if these are more than 365 days old.
Delete failed MultiParts Uploads after 7 days
Configuration anatomy for LEVIIA Storag3:
Rules: List of lifecycle rules
ID: Unique rule identifier
Status: Rule status (Enabled/Disabled)
Filter: Filters to target specific objects
Expiration: Configuration for deletion of current objects
ExpiredObjectDeleteMarker: Deletes expired deletion markers
NoncurrentVersionExpiration: Configuration for older versions
NoncurrentDays: Number of days before deletion
NewNoncurrentVersions: (optional) Minimum number of versions to keep
AbortIncompleteMultipartUpload: Configuration for incomplete uploads
DaysAfterInitiation: Number of days before cleanup
Important notes:
Lifecycle rules are executed asynchronously, so there may be a delay between configuration and actual application.
To test your rules, we recommend that you first apply the configuration to a test bucket before using it in production.
Objects protected by S3 Object Lock (immutability) will not be deleted by lifecycle rules before the end of their retention period.
Automatically deleting expired delete markers
Managing obsolete versions of versioned objects
Cleaning up incomplete multipart uploads
Expired delete markers:
This rule automatically cleans up expired delete markers.
A delete marker is considered expired when it is the only remaining version of an object (all other versions having been deleted).
{
"Rules": [
{
"ID": "LEVIIA-Supprimer-Marqueurs-Expirés",
"Status": "Enabled",
"Filter": {},
"Expiration": {
"ExpiredObjectDeleteMarker": true
}
}
]
}
2. Non-current versions (obsolete versions)
Out-of-date versions will be deleted 365 days after becoming out-of-date. In addition to the current version, the 5 most recent non-current versions will be retained, even if they exceed the 365-day period.
The values for 365 days and 5 versions can be adjusted in your JSON file to suit your needs.
{
"Rules": [
{
"ID": "LEVIIA-G\u00e9rer-Versions-Non-Courantes",
"Status": "Enabled",
"Filter": {},
"NoncurrentVersionExpiration": {
"NoncurrentDays": 365,
"NewerNoncurrentVersions": 5
}
}
]
}
3. Incomplete multipart uploads
Incomplete multipart uploads will be deleted 7 days after initiation. This 7-day value can be adjusted in your JSON file to suit your needs.
{
"Rules": [
{
"ID": "LEVIIA-Nettoyer-Uploads-Multipart",
"Status": "Enabled",
"Filter": {},
"AbortIncompleteMultipartUpload": {
"DaysAfterInitiation": 7
}
}
]
}
It's also possible to combine all these rules into a single one:
JSON example combining the 3 rules above:
{
"Rules": [
{
"ID": "LEVIIA-Configuration-Combinée",
"Status": "Enabled",
"Filter": {},
"Expiration": {
"ExpiredObjectDeleteMarker": true
},
"NoncurrentVersionExpiration": {
"NoncurrentDays": 365,
"NewerNoncurrentVersions": 5
},
"AbortIncompleteMultipartUpload": {
"DaysAfterInitiation": 7
}
}
]
}
In this combined example, the lifecycle:
Deletes expired Delete Markers
Deletes out-of-date versions after 365 days, while always retaining the 5 latest versions, even if these are more than 365 days old.
Delete failed MultiParts Uploads after 7 days
Configuration anatomy for LEVIIA Storag3:
Rules: List of lifecycle rules
ID: Unique rule identifier
Status: Rule status (Enabled/Disabled)
Filter: Filters to target specific objects
Expiration: Configuration for deletion of current objects
ExpiredObjectDeleteMarker: Deletes expired deletion markers
NoncurrentVersionExpiration: Configuration for older versions
NoncurrentDays: Number of days before deletion
NewNoncurrentVersions: (optional) Minimum number of versions to keep
AbortIncompleteMultipartUpload: Configuration for incomplete uploads
DaysAfterInitiation: Number of days before cleanup
Important notes:
Lifecycle rules are executed asynchronously, so there may be a delay between configuration and actual application.
To test your rules, we recommend that you first apply the configuration to a test bucket before using it in production.
Objects protected by S3 Object Lock (immutability) will not be deleted by lifecycle rules before the end of their retention period.
Updated on: 28/05/2025
Thank you!