github gruntwork-io/terragrunt alpha-2025051001

latest releases: v0.87.0, v0.86.3, alpha-2025090302...
pre-release3 months ago

⚠️ Alpha Release

Terragrunt CLI configuration file

Config path

The path to the file can be specified using CLI arg --cli-config-file (hidden) or env var TG_CLI_CONFIG_FILE.

If the path is not specified explicitly, it tries to find in the following directories:

  1. In the specified TG working directory.
  2. In the repository root directory.
  3. In .config located in the repository root directory.
  4. In config dirs, depending on the OS, for unix OS this may be HOME or XDG_CONFIG_HOME/terragrunt directory.

For unix OS, the default file name is .terragruntrc.json, for Windows is terragruntrc.json.

Config keys and values

Configuration values ​​have the lowest priority compared to CLI args and Env vars, and are thus overwritten when CLI args or env vars are explicitly specified.
The name of the key-values ​​corresponds to the name of their flags, but with some exceptions for some of them. Global flags and flags belong to the run command have the same keys as their CLI args, but for others you need to prepend the name of their commands. For example:

  • The key for the terragrunt --log-level flag is log-level
  • The key for the terragrunt run --tf-forward-stdout flag is tf-forward-stdout
  • The key for the terragrunt list --format flag is list-format
  • The key for the terragrunt hcl format --exclude-dir flag is hcl-format-exclude-dir

The key names are case insensitive. You can also use _ in keys instead of -. For example: hcl-format-exclude-dir is equivalent to HCL-Format-exclude_diR

If a non-existent key is specified, a warning is be displayed. Log example:

WARN  CLI configuration file contains unused keys: nooon_interactive

Configuration value validation is the same as CLI args validation. Log example:

ERROR  Could not apply CLI config: invalid value "infoooo" for key "log-level": invalid level "infoooo", supported levels: stderr, stdout, error, warn, info, debug, trace

Debugging

Logging at level debug outputs information indicating where the flag value was taken from. This way you can understand what value is used for the flag if the same flag was set in different places: cli-config, env-var or cli-args. Log example:

DEBUG  Using cli-config "tf-path=tofu"
DEBUG  Using cli-config "strict-control=[spin-up tear-down]"
DEBUG  Using evn-var "TG_LOG_LEVEL=trace"
DEBUG  Using evn-var "TG_NON_INTERACTIVE=true"
DEBUG  Using cli-argument "working-dir=/path/to/working/dir"

Don't miss a new terragrunt release

NewReleases is sending notifications on new releases.