Skip to content
🧪 The terragrunt-v1 docs are open for feedback! 🧪
This site will eventually replace the terragrunt.io site.
To give feedback on your experience with the new docs, 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_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_SHOW_CONFIG_PATH

--inputs

Validate that all variables are set by the module a unit provisions.

When enabled, Terragrunt will validate that all variables are set by the module a unit provisions.

Example:

Terminal window
terragrunt hcl validate --inputs
Type: bool

Environment Variables:

  • TG_INPUTS

--strict

Throw an error if any inputs are set that are not defined in the module that a unit provisions.

When enabled, Terragrunt will throw an error if any inputs are set that are not defined in the module that a unit provisions.

Example:

Terminal window
terragrunt hcl validate --inputs --strict
Type: bool

Environment Variables:

  • TG_STRICT