Skip to content
👷 The Terragrunt website redesign is Work In Progress! 👷
For a list of outstanding TODOs see this.
To give feedback, click here.

validate

Usage

Recursively find HashiCorp Configuration Language (HCL) files and validate them.

Examples

Discover all HCL files in the current directory, and validate them.

Terminal window
terragrunt hcl validate

Flags

--json

Output the result in JSON format.

When enabled, Terragrunt will output the validation results in JSON format, making it easier to parse and process programmatically.

Example:

Terminal window
terragrunt hcl validate --json
Type: bool

Environment Variables:

  • TG_HCLVALIDATE_JSON

--show-config-path

Show a list of files with invalid configuration.

When enabled, Terragrunt will display the full paths of files that contain invalid HCL configurations. This is particularly useful when validating multiple files to quickly identify which files need attention.

Example:

Terminal window
terragrunt hcl validate --show-config-path
Type: bool

Environment Variables:

  • TG_HCLVALIDATE_SHOW_CONFIG_PATH