Lifecycle rules
PUT /v1/buckets/{bucket}/lifecycle replaces the whole configuration. Each rule
needs a status and at least one action; a rule with status: disabled stays in
the configuration but is skipped during evaluation.
- Console
- API
- CLI
- Go
The bucket’s Management tab has a Lifecycle rules card. Add
rule gives you a Prefix filter and the day-based actions: Expire
current objects after (days), Expire noncurrent versions after
(days) with an optional Always keep newest (versions), and Abort
incomplete multipart uploads after (days). Each rule has its own enable
switch, and Save writes the whole set.
Rules are evaluated independently, so an object matching several is subject to
all their actions.
filter.prefix narrows a rule; an absent or empty filter
applies it to the whole bucket.
A transition keeps the object’s identity — same key, same version id, same
last-modified — and moves only its bytes. That is what makes pairing a
transition with an expiration work: the move does not restart the expiry
clock.
- A transition must come strictly before the rule’s expiration. Otherwise the object would be deleted before it ever moved.
- One transition per rule. With two storage classes a second has nowhere to
go. The S3 endpoint accepts a single-element
<Transition>list and rejects longer ones rather than applying the first and ignoring the rest.