⚡ ~/naveed Interview Prep
⚡ Portfolio Home 👤 About Naveed Bio & Credentials 📫 Contact Naveed Get In Touch ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 1,000+ Scenarios ☸️ Kubernetes Mastery Hub 24 Modules 🎮 DevOps Arcade & Quizzes Subnet Blitz ⚡ 🗺️ DevOps Roadmaps PDFs & Guides 🤖 Morpheus Analysis AI Quant ↗ 🛠️ Developer Tools Utilities 🧪 Labs & Experiments 📄 Interactive CV & Certs 🔗 All Links & Socials ⚡ Join The Dispatch (Weekly SRE Newsletter) →
← Back to All Terraform & IaC Interview Questions Scenario 46 of 120 in Terraform & IaC
Staff SRE / Principal Architect [L3] Terraform Terraform Modules & State Staff SRE Scenario [L3]
🎯 Target Role / Context: Terraform Scenario #41 (L3) · Use VPC ID from another module

Q: How do you implement zero-downtime Terraform changes for an ALB?

For listener rule changes: create new rule before deleting old. create_before_destroy. For target group changes: add new TG to ALB, shift traffic, remove old TG. Use weighted routing to gradually shift.

#Terraform #L3 #IaC #Cloud Infrastructure #ALB
🎙️ Candidate Opening & Architectural Context
""Managing infrastructure as code across multiple teams requires disciplined state management and locking. When addressing this question, I walk the interviewer through our production incident runbook: isolating the blast radius, checking diagnostic logs and metrics, and applying a safe fix.""
Advertisement
⚡ Recommended Practice Lab

Want to master this scenario in a live sandbox? KodeKloud's HashiCorp Certified Terraform Associate (003) Interactive Labs covers this exact problem with hands-on terminal drills.

🛠️ Production Runbook & Step-by-Step Resolution

Direct Answer: "Managing infrastructure as code across multiple teams requires disciplined state management and locking. When addressing this question, I walk the interviewer through our production incident runbook: isolating the blast radius, checking diagnostic logs and metrics, and applying a safe fix."

1️⃣

Production Solution & Architecture

For listener rule changes: create new rule before deleting old. create_before_destroy. For target group changes: add new TG to ALB, shift traffic, remove old TG. Use weighted routing to gradually shift.

💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: For listener rule changes: create new rule before deleting old. create_before_destroy. For target group changes: add new TG to ALB."
⚡ 60-Second Elevator Pitch Talking Points
  • Immediate Triage: For listener rule changes: create new rule before deleting old. create_before_destroy. For targ
  • Run targeted verification commands before modifying configuration.
  • Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
⛔ Critical Candidate Mistakes to Avoid in This Scenario

Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:

  1. Configuring application keepalive timeouts shorter than the Application Load Balancer idle timeout when addressing zero-downtime When backend app keepalive is shorter than the ALB timeout (default 60s), the app closes connections while ALB routes new requests, triggering intermittent 502 errors.
  2. Overlooking Target Group health check path misconfigurations when registering new backend services Pointing health checks to deep authenticated endpoints instead of dedicated /healthz endpoints leads to false-positive target evictions.
  3. Neglecting cross-zone load balancing configuration on Network Load Balancers (NLB) NLBs route traffic within the receiving Availability Zone by default; without cross-zone balancing enabled, uneven client traffic skews backend target load.
  4. Failing to inspect ALB access logs via Amazon Athena during intermittent 5xx latency spikes ALB access logs reveal request processing time, target response time, and exact client TLS ciphers necessary to diagnose edge latency anomalies.
Advertisement
Want more Terraform & IaC scenarios?
Explore our complete collection of scenario-based Terraform & IaC interview runbooks.
Browse All Terraform & IaC Questions →