👋 Hello DevOps Gurus!
I’m working on infrastructure automation using Terraform and I’m a bit stuck! 🛠️
I want to know:
👉 What’s the best practice to manage multiple environments (like Dev, QA, UAT, Prod) using Terraform?
-
Should I create separate state files? 📂
-
Or use workspaces? 🏢
-
Or keep everything in separate folders/modules? 📦
I want to keep things clean, scalable, and easy to manage. ✨
💡 What strategy do you recommend and why?
Any real-world insights or examples would be super helpful! 💬
Thanks in advance! 🙏

Sarthak VarshneyPosted Jul 15, 2025, 5:52 AM
Hello @Ck_Nitin sir
I’ve worked with Terraform for managing different environments, and here's what I’ve found works best:
dev/,qa/,prod/, and inside each, I keep their ownmain.tf,variables.tf, andterraform.tfvars. This keeps everything clear and separate. It's easy to test changes in dev without touching prod.So overall:
Ck NitinPosted Jul 15, 2025, 5:55 AM
Thank you, Sarthak