Interview Prep/Terraform/Pipelines Terraform Cloud and OpenTofu

Two PRs merge close together and both apply to the same stack. What prevents trouble?

IntermediateScenarioPipelines Terraform Cloud and OpenTofu
Answer

Situation read → Concurrent applies to one state.

What I'd do →

  1. Backend locking guarantees only one writer at a time.
  2. A CI concurrency group per stack serialises runs without cancelling an in-flight apply.
  3. Plans are re-created on the merged commit, so a stale PR plan is never applied.

Why → Locking prevents corruption; serialisation prevents confusing failures.

Interview tip → cancel-in-progress: false for applies. Cancelling an apply can leave partial state.

All Terraform questions Roadmap: Terraform in production

More on Pipelines Terraform Cloud and OpenTofu