How amazing would be to provision an application that whenever it is no longer in use, it will destroy itself automatically?! 🤯
In this post, I will go through some use cases, the architecture diagram and every service needed for a self-destructing infrastructure in AWS. The fun part is that you can add any additional resource you need to the architecture!
Motivation
Sometimes, developers would provision a lot of services to test their applications and then forget to delete them, incurring extra expenses.
In an internal initiative along with a great colleague, I was asked by my managers to find a creative solution this problem. So my peer focused on configuring the application automatically on an EC2 Instance, while I was working on building an infrastructure that could delete itself.
In which scenarios would I need this?
Lets say you want to create a development environment to test new code. With this architecture you can create and delete environments on demand, reducing costs and even increasing efficiency.
Another example would be to use it on event-based workloads, such as conferences or workshops. To host these events you might need servers and storage, but for a very short time. By using a self-destructive architecture you could easily delete everything after the event, reducing complexity.
What about an application for disaster recovery? In the event of an outage you could transfer your traffic to this infrastructure. Once the original is restored and you route the traffic back, this environment would be automatically deleted.
How does it work?
This architecture is provisioned with
Here is the architecture in motion:
Now, the only thing left to do is to stop using the application and wait… ⏰
So go ahead and provision your stack, open your application and then stop using it. The CPU utilization will drop and eventually start deleting itself. Believe me, it is a great feeling to see how it automatically gets deleted. 🥲
Conclusion
Building an automatic self-destructive architecture its a solution that you can implement in your temporary projects to save costs, increase application efficiency, reduce complexity and even recover from disaster or outage.
I invite you to test it out, break it and come with new solutions around it. I would love to hear any feedback or improvements you might find! 🔍
👩💻Lets keep building!

SOCIAL SHARE CARD GENERATOR