Skip to content
Latchkey

Terragrunt prompt hang without --terragrunt-non-interactive in CI

Terragrunt asks for confirmation before applying, creating backend resources, or running run-all across many units. In CI there is no TTY to answer, so the step hangs until timeout or fails on EOF. Pass --terragrunt-non-interactive to auto-answer.

What this error means

A run-all apply step hangs at "Are you sure you want to run apply in each folder? (y/n)" and eventually times out, or fails reading from a closed stdin.

terragrunt
Are you sure you want to run 'terragrunt apply' in each folder of the stack described
above? (y/n)
ERRO[0600] The command was cancelled: no input was received (running non-interactively).

Common causes

Terragrunt is prompting in a non-TTY environment

run-all apply and backend bootstrap prompt for confirmation, but CI has no interactive terminal to answer.

terraform -auto-approve alone is not enough

Even with -auto-approve on the terraform command, Terragrunt's own run-all prompt still blocks without the non-interactive flag.

How to fix it

Pass the non-interactive flag

Run all Terragrunt commands non-interactively so prompts are auto-answered.

Terminal
terragrunt run-all apply --terragrunt-non-interactive -auto-approve

Set it via environment for every step

Export the env var so all Terragrunt invocations in the job are non-interactive.

.github/workflows/ci.yml
env:
  TERRAGRUNT_NON_INTERACTIVE: 'true'

How to prevent it

  • Always pass --terragrunt-non-interactive in CI.
  • Add -auto-approve for apply and destroy in automation.
  • Set a step timeout so a stray prompt fails fast instead of hanging.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →