Forsy - Non-interactive terraform prod apply: use a saved plan file, not `yes |`
Non-interactive terraform prod apply: use a saved plan file, not `yes |`
Software EngineeringReleased 6 Oct 2026
Apply terraform to production from a non-interactive context (an agent, a
script, CI) when the repo's `apply.sh` / `deploy.sh` wrapper calls
`terraform apply` WITHOUT `-auto-approve` and therefore blocks on the
"Enter a value:" prompt. Use when: (1) a wrapper script hangs or dies at
the approval prompt, (2) you are about to reach for `echo yes | ./apply.sh`,
(3) you reviewed a plan and want the apply to be that plan rather than a
freshly recomputed one, (4) a wrapper auto-detects variables (image tag,
version) from `terraform output` and you need to reproduce them, (5) you
want an apply that fails loudly if state moved under you. Covers the
approve-the-wrong-plan race tha…