You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(standards): add terragrunt to terraform standards
Add terragrunt hclfmt as companion formatter, configuration section,
Makefile targets, and pre-commit hook guidance to terraform standards.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The `tests/` directory must contain a `go.mod` file for the test module.
112
113
114
+
### terragrunt hclfmt
115
+
116
+
No config file required. Terragrunt is a companion tool that runs automatically when `terragrunt.hcl` files are detected in the project. It formats Terragrunt HCL files to a canonical style.
117
+
118
+
```bash
119
+
# Check formatting (exits non-zero if files need formatting)
120
+
terragrunt hclfmt --terragrunt-check
121
+
122
+
# Apply formatting
123
+
terragrunt hclfmt
124
+
```
125
+
126
+
Projects that do not use Terragrunt are unaffected — the formatter is silently skipped when no `terragrunt.hcl` files exist.
127
+
113
128
### terraform-docs
114
129
115
130
No config file required for default operation. Generates markdown documentation from Terraform module inputs, outputs, and descriptions.
|`make test`|`cd tests && go test -v -timeout 30m`| Run terratest suite |
@@ -153,6 +170,8 @@ repos:
153
170
hooks:
154
171
- id: terraform_fmt
155
172
- id: terraform_tflint
173
+
# Uncomment if using Terragrunt:
174
+
# - id: terragrunt_fmt
156
175
```
157
176
158
177
### CI-Only (too slow for local hooks)
@@ -164,7 +183,7 @@ repos:
164
183
165
184
## Notes
166
185
167
-
- **`terraform fmt` is the only accepted formatter.** Do not use third-party HCL formatters.
186
+
-**`terraform fmt` is the only accepted formatter**for `.tf` files. Do not use third-party HCL formatters. Terragrunt HCL files (`terragrunt.hcl`) are formatted by `terragrunt hclfmt`.
168
187
-**Both `tfsec` and `checkov` run as part of `make security`.** They are complementary: tfsec focuses on Terraform-specific misconfigurations, checkov applies broader policy-as-code rules.
169
188
-**`terraform-docs` runs as part of `make docs`.** Place `<!-- BEGIN_TF_DOCS -->` / `<!-- END_TF_DOCS -->` markers in your `README.md`.
170
189
-**`terratest` tests are written in Go.** The `tests/` directory must contain a `go.mod` file.
0 commit comments