Pipeline jobs that run terraform plan sometimes hang until they time out. The logs show Terraform waiting for a value for a variable that has no default and that the job did not supply. How should the team make these jobs fail immediately instead of waiting?
Select an answer to reveal the explanation.
Short Explanation
Your pipeline is a room with nobody in it, so a prompt is a question asked to an empty chair. -input=false tells Terraform not to ask at all and to fail straight away. TF_IN_AUTOMATION sounds like it should do that, but it just tidies the messages.
Full Explanation
By default Terraform prompts interactively for root module variables that have no value from defaults, variable files, environment variables or command-line flags. In automation there is no one to answer, so the job waits until it times out. The -input=false option disables that prompting, causing Terraform to stop with an error that names the missing variable; TF_INPUT set to false or 0 has the same effect through the environment. HashiCorp recommends it for non-interactive automation. TF_IN_AUTOMATION, when set to any non-empty value, only adjusts output so Terraform does not suggest specific next commands that make no sense in a pipeline; it does not disable prompts. -auto-approve skips the interactive approval of a plan during apply and has no effect on variable prompts; it is not a plan option at all. -compact-warnings shortens warning output and has nothing to do with input. Exam caveat: the -json UI mode implies -input=false, so JSON-driven automation already fails on unassigned variables. Operational check: run the job with a deliberately missing variable and confirm it exits non-zero within seconds with an error naming that variable.