Lifecycle Management
A lifecycle rule is an instruction on a bucket that deletes objects automatically when they reach a certain age or date. Use it so old logs, temporary exports or expired backups don’t pile up and keep costing money. A rule can cover the whole bucket or only keys that start with a prefix, such as logs/.
When to use a lifecycle rule
How it works
- You add a rule with a prefix (or none, for every object) and an expiry: a number of days after upload, or a date.
- The storage system checks objects in the background and deletes the ones that match once they are past the expiry.
- Deleted objects stop being counted for storage from the next billing month. See Pricing.
Before you begin
- A bucket. See Create a bucket.
- Write access to the bucket’s settings in the portal, or a platform API token with
object-storage.write. - Know the prefix: keys are case-sensitive, so
Logs/andlogs/are different.
Objects removed by a lifecycle rule are deleted permanently (unless the bucket has versioning through Object Lock). Test a new rule on a narrow prefix first.
Add a rule in the portal
Open Lifecycle Policies
Open the bucket, click Settings, then Lifecycle Policies. A bucket without rules shows No lifecycle rules.
Choose the expiry
Under Lifecycle actions, tick Expire after, then choose Days (for example 30) or Date. At least one action must be ticked: Select at least one action before applying changes.
Incomplete uploads and Transition after also appear in the form, but the storage service doesn’t apply them yet.
Add a rule with the API
PUT replaces all the bucket’s rules with the list you send, so include every rule you want to keep. Each rule needs status and either expiration_days (1 or more) or expiration_date, not both.
GET on the same path returns the rules; DELETE removes all of them and needs object-storage.delete. The S3 call PutBucketLifecycleConfiguration returns 501 on the S3 endpoint; use these operations.
Verify
- The rule card shows the prefix, Enabled and Expire after 30 days (or your date).
GET …/lifecyclereturns your rule.- To test, add a rule with Expire after → 1 day on a test prefix, upload a file there, and check the next day or later that it’s gone.
Manage rules
- Edit: click the rule card, change the fields, click Apply changes.
- Turn off: use the toggle on the card. The rule stays saved.
- Delete: click the delete icon, then Delete in the Delete lifecycle rule dialog.
