Missing TTY Flag Silently Stalled Terraform CI Pipeline for Three Hours

A Terraform pipeline running in a CI environment like GitHub Actions can hang indefinitely when interactive prompts go unhandled, as there is no human operator to provide keyboard input. Unlike a local terminal, CI runners have no TTY session, so Terraform waits silently for input rather than throwing an immediate error. This silent stall can exhaust CI build credits and trigger timeout alerts hours later before anyone notices. The fix involves setting the TF_IN_AUTOMATION and TF_INPUT environment variables alongside CLI flags such as -input=false and -auto-approve to force strictly non-interactive execution. Applying these settings ensures Terraform fails fast with an actionable exit code whenever an unexpected prompt is encountered, rather than hanging the pipeline.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in