Problem Statement
Explain how you would design a multi-environment setup in Terraform for dev, staging, and production.
Explanation
A multi-environment Terraform setup typically uses workspaces or separate state files for each environment.
Configurations are modularized with environment-specific variable files that define distinct parameters such as instance size, region, or scaling limits. The same base modules are reused across environments, ensuring consistency. Remote backends are configured for each environment to isolate state and reduce risk, while CI/CD pipelines automate promotion from dev to production with approval gates.
