Skip to content

Commit 02ffc4f

Browse files
committed
docs: Clarify what exactly terragrunt hooks do. Document
`terragrunt_validate`
1 parent 15a76d6 commit 02ffc4f

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ If you want to support the development of `pre-commit-terraform` and [many other
7171
* [terrascan](#terrascan)
7272
* [tfupdate](#tfupdate)
7373
* [terragrunt\_providers\_lock](#terragrunt_providers_lock)
74+
* [terragrunt\_validate](#terragrunt_validate)
7475
* [terragrunt\_validate\_inputs](#terragrunt_validate_inputs)
7576
* [Docker Usage](#docker-usage)
7677
* [About Docker image security](#about-docker-image-security)
@@ -338,8 +339,8 @@ There are several [pre-commit](https://pre-commit.com/) hooks to keep Terraform
338339
| `terraform_trivy` | [Trivy][trivy repo] static analysis of terraform templates to spot potential security issues. [Hook notes](#terraform_trivy) | `trivy` |
339340
| `terraform_validate` | Validates all Terraform configuration files. [Hook notes](#terraform_validate) | `jq`, only for `--retry-once-with-cleanup` flag |
340341
| `terragrunt_fmt` | Reformat all [Terragrunt][terragrunt repo] configuration files (`*.hcl`) to a canonical format. | `terragrunt` |
341-
| `terragrunt_validate` | Validates all [Terragrunt][terragrunt repo] configuration files (`*.hcl`) | `terragrunt` |
342-
| `terragrunt_validate_inputs` | Validates [Terragrunt][terragrunt repo] unused and undefined inputs (`*.hcl`) | |
342+
| `terragrunt_validate` | Validates all Terraform configuration files in [Terragrunt][terragrunt repo]. [Hook notes](#terragrunt_validate). | `terragrunt` |
343+
| `terragrunt_validate_inputs` | Validates [Terragrunt][terragrunt repo] configurations, and unused and undefined inputs (`*.hcl`). [Hook notes](#terragrunt_validate_inputs). | `terragrunt` |
343344
| `terragrunt_providers_lock` | Generates `.terraform.lock.hcl` files using [Terragrunt][terragrunt repo]. | `terragrunt` |
344345
| `terraform_wrapper_module_for_each` | Generates Terraform wrappers with `for_each` in module. [Hook notes](#terraform_wrapper_module_for_each) | `hcledit` |
345346
| `terrascan` | [terrascan][terrascan repo] Detect compliance and security violations. [Hook notes](#terrascan) | `terrascan` |
@@ -1185,12 +1186,30 @@ It invokes `terragrunt providers lock` under the hood and terragrunt [does its o
11851186
- --args=-platform=linux_amd64
11861187
```
11871188

1189+
### terragrunt_validate
1190+
1191+
Validates _TF_ configurations. Does not validate anything inside Terragrunt HCL files.
1192+
1193+
See Terragrunt docs for [`terragrunt run -- validate`](https://docs.terragrunt.com/reference/cli/commands/run) for more details.
1194+
1195+
Example:
1196+
1197+
```yaml
1198+
- id: terragrunt_validate
1199+
name: Terragrunt validate underlying Terraform/Tofu configurations
1200+
args:
1201+
# `tf validate` options
1202+
- --args=-json
1203+
- --args=-no-color
1204+
```
1205+
1206+
11881207
### terragrunt_validate_inputs
11891208
1190-
Validates Terragrunt unused and undefined inputs. This is useful for keeping
1209+
Validates Terragrunt HCL files and unused and undefined inputs. This is useful for keeping
11911210
configs clean when module versions change or if configs are copied.
11921211
1193-
See the [Terragrunt docs](https://terragrunt.gruntwork.io/docs/reference/cli-options/#validate-inputs) for more details.
1212+
See the Terragrunt docs for [`terragrunt hcl validate --inputs`](https://docs.terragrunt.com/reference/cli/commands/hcl/validate/#inputs) for more details.
11941213

11951214
Example:
11961215

0 commit comments

Comments
 (0)