Skip to content

Commit

Permalink
feat: Adding more documentation on validation (#3262)
Browse files Browse the repository at this point in the history
  • Loading branch information
yhakbar authored Jul 11, 2024
1 parent bb9802d commit 2e7f05c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/_docs/04_reference/cli-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,22 @@ terragrunt hclvalidate
This will search all hcl files from the configuration stack in the current working directory and run the equivalent
of `terraform validate` on them.

For convenience in programmatically parsing these findings, you can also pass the `--terragrunt-hclvalidate-json` flag to output the results in JSON format.

Example:

```bash
terragrunt hclvalidate --terragrunt-hclvalidate-json
```

In addition, you can pass the `--terragrunt-hclvalidate-invalid` flag to only output the invalid files, delimited by newlines. This can be especially useful when combined with the [terragrunt-excludes-file](#terragrunt-excludes-file) flag.

Example:

```bash
terragrunt hclvalidate --terragrunt-hclvalidate-invalid
```

### aws-provider-patch

Overwrite settings on nested AWS providers to work around several Terraform bugs. Due to
Expand Down Expand Up @@ -964,6 +980,12 @@ Path to a file with a list of directories that need to be excluded when running
excluded during execution of the commands. If a relative path is specified, it should be relative from
[--terragrunt-working-dir](#terragrunt-working-dir). This will only exclude the module, not its dependencies.

This flag has been designed to integrate nicely with the `hclvalidate` command, which can return a list of invalid files delimited by newlines when passed the `--terragrunt-hclvalidate-invalid` flag. To integrate the two, you can run something like the following using bash process substitution:

```bash
terragrunt run-all plan --terragrunt-excludes-file <(terragrunt hclvalidate --terragrunt-hclvalidate-invalid)
```

### terragrunt-exclude-dir

**CLI Arg**: `--terragrunt-exclude-dir`<br/>
Expand Down

0 comments on commit 2e7f05c

Please sign in to comment.