I Deleted an EC2 Instance Behind Terraform's Back. Here's What Happened

In my previous Terraform post, I built a disposable Ubuntu EC2 instance with Docker installed. I could run terraform apply, get a clean Docker host, use it and destroy it when I was done. That solved the problem I had at the time. But what happens if I lose the state file? What happens if somebody deletes the instance directly in AWS? Does Terraform immediately create another one like Kubernetes would? What happens when a resource has to be replaced, and how do I stop a bad Terraform change from quietly reaching main? ...

October 18, 2026 · 11 min

I Got Tired of Rebuilding Docker Test Environments, So I Terraform’d It

I’m rebuilding part of my AWS setup and figured this was a good time to write this down instead of relying on memory. Any time I need a clean Docker environment to test images or mess around without breaking anything important, I really don’t want to be clicking through the AWS console or babysitting a server. Usually, the problem is me needing an Ubuntu box, Docker installed, basic access set up. Doing this manually means clicking through EC2, setting up security groups, opening ports, SSH’ing in, installing Docker, and then deciding what to do with the instance when I’m done. ...

January 12, 2026 · 5 min