Saurav Chaudhary’s Post

View profile for Saurav Chaudhary

🚀 Building Scalable, Resilient, and Automated Systems That Don’t Break!

🚨 Life-Saving Terraform Commands Every DevOps Engineer Must Know! Bookmark this for the future. 1. State File Discipline (InfraThrone Rule #1) terraform init -reconfigure terraform plan -refresh-only terraform state list terraform state show <resource> 2. Mid-Deploy Chaos terraform apply -target=<resource> terraform destroy -target=<resource> terraform refresh terraform plan -detailed-exitcode 3. State Locking Issues terraform force-unlock <lock-id> terraform state pull > backup.tfstate terraform state push backup.tfstate 4. Drift & Debugging terraform plan -out=tfplan terraform show -json tfplan | jq terraform providers terraform graph | dot -Tpng > graph.png 5. The Elite Recovery Edge terraform taint <resource> terraform untaint <resource> terraform import <resource> <id> terraform workspace list terraform workspace select <env> Takeaway: Terraform is the backbone of infra. These aren’t “just commands.” They’re how you recover from broken states, half-applied deploys, and million-dollar outages. 📌 Want the full Terraform troubleshooting guide with real RCA drills and production scenarios? ⭕️ Repost this. I’ll DM you the full playbook. #DevOps #Terraform #SRE #IaC #Troubleshooting #InfraThrone #RCADrills

  • text
Tarak ☁️

building infracodebase.com - AI that learns from your docs, diagrams & codebase to help teams manage and scale infrastructure with context and security in mind.

1mo

This brought back some memories. I’ve definitely had nights saved by terraform state and force-unlock when a deployment froze mid-flight. What I’ve noticed is that the difference between a minor hiccup and a full-blown incident often comes down to how comfortable the team is with these recovery commands. It’s one thing to know them in theory, it’s another to be calm enough at 2 a.m. to run terraform state show or terraform import without making things worse. One trick that’s helped me is treating drift and state repair almost like fire drills, we run controlled “broken state” simulations in staging so people practice with taint, import, and state pushes under pressure. That way, by the time it happens in prod, no one’s googling syntax in panic mode. Curious if you’ve done something similar, do you encourage teams to practice recovery workflows, or do you rely more on clean CI/CD patterns to avoid ever needing these commands in the first place?

Mohsinkamaal Mulla

DevOps Engineer | Helping teams build reliable & scalable cloud infrastructure on Azure | CI/CD (Azure DevOps, GitHub Actions, GitLab) | Infrastructure as Code (IaC) with Terraform | PowerShell & Shell Scripting

1mo

Great insights Saurav Chaudhary

Like
Reply
Ruhon Deb

DevOps Engineer | Skilled in Web & API Security | Bug Bounty Hunter | Passionate About Automating Secure Systems & Finding Real-World Vulnerabilities

1mo

Thanks for sharing 🙂

Like
Reply
See more comments

To view or add a comment, sign in

Explore content categories