Interview Prep/Terraform/Pipelines Terraform Cloud and OpenTofu

How do you promote the same Terraform code from dev to stage to prod?

AdvancedScenarioPipelines Terraform Cloud and OpenTofu
Answer

Situation read → Promotion needs to move through environments with the same module versions.

What I'd do →

  1. Tag module releases; environments pin versions in their own directory.
  2. Pipeline: merge → apply dev → automated checks → apply stage → manual approval → apply prod, each with its own plan.
  3. Keep environment differences in tfvars only.

Why → What was proven in dev is the same code in prod; only inputs differ.

Interview tip → Plans are per-environment; never promote a plan file.

All Terraform questions Roadmap: Terraform in production

More on Pipelines Terraform Cloud and OpenTofu