Skip to content

Commit 8d81f04

Browse files
docs(standards): add blog post for terragrunt support (#10)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e94f7ca commit 8d81f04

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: "Terragrunt Support"
3+
date: 2026-03-05
4+
description: "Terragrunt formatting ships as a companion to Terraform -- automatic detection, no configuration required."
5+
---
6+
7+
Terragrunt is now included in the dev-toolchain container as a companion tool to Terraform. Projects that use `terragrunt.hcl` files get automatic format checking with zero configuration.
8+
9+
## How It Works
10+
11+
There is no new language entry. Terragrunt runs within the existing `terraform` language block. If your project already declares `terraform` in `.devrail.yml`, Terragrunt formatting is available immediately.
12+
13+
The Makefile detects `terragrunt.hcl` files at runtime:
14+
15+
- **`make format`** runs `terragrunt hclfmt --terragrunt-check` -- exits non-zero if files need formatting
16+
- **`make fix`** runs `terragrunt hclfmt` -- formats files in place
17+
18+
If no `terragrunt.hcl` files exist, the check is silently skipped. Projects that use Terraform without Terragrunt are unaffected.
19+
20+
```console
21+
$ make format
22+
✓ terraform fmt -check -recursive
23+
✓ terragrunt hclfmt --terragrunt-check
24+
```
25+
26+
## Why a Companion Tool
27+
28+
Terragrunt is a thin wrapper around Terraform for DRY infrastructure code across multiple modules. It uses its own HCL configuration files (`terragrunt.hcl`) that `terraform fmt` does not process. Adding `terragrunt hclfmt` as a companion means teams get consistent formatting for both file types from a single `make check` invocation.
29+
30+
The alternative -- a separate `terragrunt` language entry in `.devrail.yml` -- would require projects to declare two languages for what is fundamentally one infrastructure stack. The companion approach is simpler: declare `terraform`, and Terragrunt support follows automatically.
31+
32+
## Pre-Commit Hooks
33+
34+
The template repositories include a commented hook for local Terragrunt formatting:
35+
36+
```yaml
37+
- repo: https://github.com/antonbabenko/pre-commit-terraform
38+
rev: v1.96.3
39+
hooks:
40+
- id: terraform_fmt
41+
- id: terraform_tflint
42+
# Uncomment if using Terragrunt:
43+
# - id: terragrunt_fmt
44+
```
45+
46+
## Get Started
47+
48+
- [Terraform standards reference](/docs/standards/terraform/) -- includes Terragrunt configuration and Makefile targets
49+
- [Container tool versions](/docs/container/versions/) -- exact versions shipped in the current image

0 commit comments

Comments
 (0)