Self-deleting Resources: Which Pattern Fits Your Platform?
A platform team I spoke with recently asked me a question: can the platform make resources delete themselves?
Sandbox accounts that should have disappeared after 30 days and test environments nobody remembers to tear down quietly cost money and worry security teams in equal measure.
This was a fantastic question because it shows they are learning to expect their platform to support them, rather than trying to reduce their use cases to fit the platform. But there is a more useful question underneath it. The same platform will often provision both a resource that should expire and one that should never expire, such as a production database, a shared service, or a long-running piece of infrastructure that would cause real damage if it vanished on a schedule.
Treat both the same way, and you will eventually get one of them badly wrong.

Three ways to make a resource delete itself
I see three patterns most often for platform resource lifecycle management, and all can work in certain circumstances. They just sit at different points on a spectrum from hard rule to soft nudge.
The platform constraint. The most governed solution is a centralised garbage collection process that runs alongside platform provisioning. This process monitors the resources it owns, evaluates them against declared rules, and acts without waiting for approval. Some teams build this with existing tools designed for exactly that job (for example, Kyverno cleanup policies in Kubernetes, or account clean-up tools such as aws-nuke), effectively teaching the platform to clean up after itself. This one is the right call for genuine sandbox or test accounts where the cost of forgetting outweighs the cost of someone losing work they should have saved elsewhere.
The user setting. While not as strict as setting a requirement for the user from a central position, this still makes the expectation clear and enforced: the platform exposes a time-to-live (TTL) field and lets the resource reconcile against it. Once the TTL has passed, the resource deletes itself. No exceptions, no reminders, just a clock running down. This is the pattern most people reach for first, and works well when you want users bought into the timelines for their resources.
User empowerment. This is the softest option and is often underrated. Rather than deleting anything automatically, the workflows that already watch the resource send warnings, suggestions, or nudges instead. These can be purely time-based, or driven by a health check: "We've noticed this hasn't been used in 14 days; would you like to delete it?" with a button to do exactly that. Nobody loses anything without choosing to.
There isn't a right answer here, only a right fit
It's tempting to pick one of these three and standardise all time-bound resources on it. I'd push back on that, because they each answer different questions. A user-set TTL guarantees a resource will never run forever. User empowerment lets the people closest to the context make the call. A platform constraint removes the responsibility from users altogether, which is only right when you can't rely on them to care.
A pure TTL model solves sprawl and quietly creates a trust problem: what happens to the person still using the environment for a legitimate reason on day 31? A pure notification model solves trust and quietly creates a sprawl problem: what happens when nobody reads the notification? Treating either as the default answer for every resource type suggests the platform has settled on a favourite mechanism rather than choosing what fits the problem in front of it.
Combining patterns: adjustable TTLs with notifications
For sandbox accounts, the team landed on letting users set the TTL themselves within a short, platform-defined range, paired with a notification workflow so users could extend the allocated time up to a point if they genuinely needed the extra runway. The bounded TTL did most of the work of preventing indefinite sprawl. But by pairing it with notifications, they turned deletion from something that happens to a user into something a user decides (within reason).
For other resource types on the same platform, that combination would be the wrong call entirely. Take a shared staging environment. Wiping it has a real cost, so a fixed clock is the wrong trigger. If it is cleaned up at all, it should be by a platform-level process that evaluates actual usage, or one that rebuilds it on a schedule to prove it can be recreated, which is a resilience test rather than a cost saving. The point isn't that adjustable TTLs are the answer. It's that a fit-for-purpose platform can support different answers for different resources without that being a special case.
This is governance, not garbage collection
None of these three patterns is really about tidying up unused infrastructure. They're about encoding a policy for how long a resource should live, and who gets to decide when it ends. By building with a platform orchestrator like Kratix, the organisation could codify this directly into the same workflows that provision the resource, rather than leaving it to a wiki page nobody reads or a Slack reminder nobody sees.
We have all felt the pain of governance that lives in documentation and doesn't scale. Documented policies depend on someone remembering to read them and someone else remembering to enforce them. Governance that lives in the platform scales by default because it runs every time the resource is evaluated, whether anyone's watching or not.
Sandbox TTLs are a small example. But they're a good test case, because if your platform can't encode "this must not exist forever" as a first-class, adjustable, observable part of a resource's lifecycle, and can't vary that encoding by resource type, it's worth asking what else is quietly relying on someone remembering to do the right thing.
Final thoughts
There's no single correct pattern for platform resource lifecycle management, and I'd be suspicious of any platform that has standardised on one. A resource built to expire and a resource built to last both need deliberate rules, and those rules will look nothing alike. The right position on the spectrum depends on how much you trust your users, how expensive it is when that trust proves misplaced, and how much the answer should differ from one resource type to the next.
We build this kind of variation into Kratix Promises at Syntasso, where a platform team can define exactly this mix of TTL, notification, and garbage collection behaviour per resource type rather than picking one globally. It's one way of implementing the idea. It isn't the idea. The idea is that lifecycle management is a design decision worth making deliberately, whatever you're building your platform on.



Comments