Skip to content

download_dir

unitoptional(string, "…")

Usage

The download_dir attribute sets the directory Terragrunt downloads OpenTofu/Terraform modules into. By default, Terragrunt creates a .terragrunt-cache directory next to the unit’s terragrunt.hcl:

  • Directoryapp
    • terragrunt.hcl
    • Directory.terragrunt-cache/
      • …

Precedence

Terragrunt uses the first of these that is set:

  1. The --download-dir flag.
  2. The TG_DOWNLOAD_DIR environment variable.
  3. download_dir in the unit’s terragrunt.hcl.
  4. download_dir in a file the unit includes.

Defaults to .terragrunt-cache.

Examples

root.hcl
download_dir = "/tmp/terragrunt/${path_relative_to_include()}"