How do you add a manual approval before prod applies?
IntermediateScenarioPipelines Terraform Cloud and OpenTofu
Answer
Situation read → Prod changes need a human gate.
What I'd do →
- Split the workflow:
planjob produces the artifact;applyjob targets a GitHubenvironment: production. - Configure that environment with required reviewers and a deployment branch rule.
- Apply the saved plan from the artifact.
apply:
needs: plan
environment: production
steps:
- uses: actions/download-artifact@v4
with: { name: tfplan }
- run: terraform apply -input=false tfplan
Why → The approver sees the exact plan; the apply is bound to it.
Interview tip → Same shape in GitLab with when: manual and protected environments.
More on Pipelines Terraform Cloud and OpenTofu
Build a basic GitHub Actions pipeline: plan on pull request, apply on merge to main.BeginnerReviewers can't read raw plan logs. How do you present the plan in the PR?IntermediateTwo PRs merge close together and both apply to the same stack. What prevents trouble?IntermediateCompare Atlantis, HCP Terraform and a hand-built GitHub Actions pipeline.IntermediateA saved plan was approved yesterday and apply fails because main changed. How do you avoid dead approvals?IntermediateExplain HCP Terraform workflows: VCS-driven, CLI-driven and API-driven.Beginner