R2 object TTL or bucket lifecycle rules?

Hello :slight_smile:

Is it possible to set a lifecycle rule on buckets in R2 or TTL on objects in R2 so they get automatically deleted after a set time?

This blog post R2 is now Generally Available mentions object lifecycles are coming and this comment from the PM for R2 mentions supporting per-object TTLs - but I can’t find anything in the docs (sorry if I’ve missed it).

Does anyone have any more info on if this is possible with R2?


I’m interested in the same thing

It isn’t currently possible - you could likely build it yourself with Durable Object Alarms or a Scheduled Worker, but it’s not ideal.

But wait a week…


That’s ace! Thanks for the update :star_struck:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.