Interview Prep/Real-World Interview/Infrastructure as Code & Terraform state

Why did you use folders per environment rather than Terraform workspaces (or vice versa)?

IntermediateBehavioralInfrastructure as Code & Terraform state
Answer

Good answer looks like → "Folders, because environments differed in real ways (prod had Multi-AZ RDS and more node groups) and separate backends let us restrict prod state access by IAM. Workspaces share one backend and configuration, which made it too easy to run apply against the wrong workspace. We used workspaces only for identical, short-lived test stacks."

Follow-ups to expect → How did you avoid duplicating code across folders? Have you used Terragrunt?

Red flags → Not knowing the trade-off at all.

All Real-World Interview questions Roadmap: Interview readiness

More on Infrastructure as Code & Terraform state