Mastering Zero-Downtime Deployments with Terraform
How I Updated Production Without Taking My App Offline (Almost) Day 12 of the 30-Day Terraform Challenge — and today I learned the difference between "it works" and "it works without anyone noticin...

Source: DEV Community
How I Updated Production Without Taking My App Offline (Almost) Day 12 of the 30-Day Terraform Challenge — and today I learned the difference between "it works" and "it works without anyone noticing." Deploying infrastructure updates without downtime is one of the hardest problems in operations. It's also one of the most valuable skills you can have. Today I made it happen. Well, almost. Let me show you what worked, what broke, and what I learned. The Problem: Terraform's Default Behavior is Destructive When you update a Launch Template or Auto Scaling Group, Terraform does something terrifying by default: 1. Destroy old ASG → All instances terminate → Website goes down ❌ 2. Create new ASG → New instances spin up → Website comes back Between step 1 and step 2, there's a window of silence. Sometimes seconds. Sometimes minutes. In production, that's a disaster. The fix? A little lifecycle rule called create_before_destroy. The Solution: create_before_destroy This simple lifecycle block f