How did you structure your Terraform code?
BeginnerBehavioralInfrastructure as Code & Terraform state
Answer
Good answer looks like → "Reusable modules in a separate repo (vpc, eks, rds, iam-role), versioned with Git tags. A live repo with envs/dev, envs/staging, envs/prod, each calling modules with environment-specific variables. Each env folder had its own backend config."
Follow-ups to expect → Workspaces or folders, and why? How did you test module changes?
Red flags → One giant main.tf for everything.
More on Infrastructure as Code & Terraform state
What did your Terraform state setup look like?IntermediateWhy did you use folders per environment rather than Terraform workspaces (or vice versa)?IntermediateHow did different Terraform stacks share information?IntermediateDid you ever have a state lock or corrupted state? What did you do?AdvancedHow did you handle Terraform drift?IntermediateHow did you import existing resources into Terraform?Intermediate