Skip to content
Latchkey

Terragrunt "Could not find terragrunt.hcl" in CI

Terragrunt walks up from the working directory looking for a terragrunt.hcl (or terragrunt.hcl.json) and found none. In CI this is almost always a wrong working-directory or a checkout that did not include the module folder.

What this error means

terragrunt fails with "Could not find terragrunt.hcl or terragrunt.hcl.json in the current directory" or "Error finding terragrunt config", before any Terraform runs.

terragrunt
ERRO[0000] Error finding terragrunt config: Could not find terragrunt.hcl or
terragrunt.hcl.json in the current directory (/home/runner/work/infra/infra) or any
of its parents. Make sure you run terragrunt from a directory that contains a config.

Common causes

The step runs from the wrong directory

The job did not cd into the environment folder (for example live/prod/vpc), so the directory Terragrunt inspects has no config.

The config folder was not checked out

A sparse checkout or a submodule that was not initialized leaves the terragrunt.hcl absent on the runner.

How to fix it

Run from the directory that holds terragrunt.hcl

  1. Confirm where your terragrunt.hcl lives in the repo tree.
  2. Set working-directory on the step, or use --terragrunt-working-dir.
  3. Re-run so Terragrunt starts inside the config folder.
.github/workflows/ci.yml
- name: Plan
  working-directory: live/prod/vpc
  run: terragrunt plan

Point Terragrunt at the config explicitly

Use the working-dir flag when you cannot change the step directory.

Terminal
terragrunt plan --terragrunt-working-dir live/prod/vpc

How to prevent it

  • Set working-directory explicitly on every Terragrunt step.
  • Use a full checkout so all environment folders are present.
  • Keep a consistent live/ directory layout so paths are predictable.

Related guides

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