[PR #180] [MERGED] Add Terragrunt support (single + multi-module) #189

Closed
opened 2026-05-06 12:38:06 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/patrickchugh/terravision/pull/180
Author: @patrickchugh
Created: 3/29/2026
Status: Merged
Merged: 3/29/2026
Merged by: @patrickchugh

Base: mainHead: 008-terragrunt-support


📝 Commits (2)

  • ce597bf claude guidance update
  • 1070484 Add Terragrunt support for single and multi-module projects

📊 Changes

15 files changed (+1448 additions, -86 deletions)

View changed files

📝 .github/workflows/lint-and-test.yml (+4 -0)
📝 .gitignore (+2 -2)
📝 docs/CLAUDE.md (+63 -81)
📝 modules/interpreter.py (+2 -0)
modules/tgwrapper.py (+628 -0)
📝 modules/validators.py (+15 -0)
📝 terravision/terravision.py (+46 -3)
tests/fixtures/terragrunt-multi/app/main.tf (+25 -0)
tests/fixtures/terragrunt-multi/app/terragrunt.hcl (+40 -0)
tests/fixtures/terragrunt-multi/vpc/main.tf (+24 -0)
tests/fixtures/terragrunt-multi/vpc/terragrunt.hcl (+27 -0)
tests/fixtures/terragrunt-single/main.tf (+7 -0)
tests/fixtures/terragrunt-single/terragrunt.hcl (+27 -0)
tests/test_terragrunt_detection.py (+76 -0)
tests/test_tgwrapper.py (+462 -0)

📄 Description

Summary

  • Auto-detects Terragrunt sources via terragrunt.hcl presence — no new CLI flags
  • Single-module: delegates to terragrunt init/plan/show/graph, feeds into existing pipeline
  • Multi-module: discovers child modules, runs per-module plans, merges with module.<name>. prefixes, parses dependency blocks with python-hcl2 to inject cross-module edges into graphdict
  • Cross-module links discovered automatically by existing add_relations() code
  • Graceful degradation: HCL parse failures skip cross-module links with a warning, diagram still renders

Resolves #114

Files Changed

  • modules/tgwrapper.py — new Terragrunt wrapper (detection, plan execution, merging, dependency parsing)
  • modules/validators.py — added is_terragrunt_source() API
  • modules/interpreter.py — guard for unknown module names in variable_map
  • terravision/terravision.py — Terragrunt detection branch in compile_tfdata()
  • .github/workflows/lint-and-test.yml — install Terragrunt on CI runners
  • Test fixtures + 33 new tests (25 unit + 8 detection)

Test plan

  • 340 tests pass locally (including 1 slow Terragrunt integration test)
  • Zero regression in existing Terraform-only test suite
  • CI runners install Terragrunt and run all tests

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/patrickchugh/terravision/pull/180 **Author:** [@patrickchugh](https://github.com/patrickchugh) **Created:** 3/29/2026 **Status:** ✅ Merged **Merged:** 3/29/2026 **Merged by:** [@patrickchugh](https://github.com/patrickchugh) **Base:** `main` ← **Head:** `008-terragrunt-support` --- ### 📝 Commits (2) - [`ce597bf`](https://github.com/patrickchugh/terravision/commit/ce597bf5da71776e81432e76c7b3dfba31e8ddb6) claude guidance update - [`1070484`](https://github.com/patrickchugh/terravision/commit/1070484d9e764c1db863c35067bedc26d3e4cc4a) Add Terragrunt support for single and multi-module projects ### 📊 Changes **15 files changed** (+1448 additions, -86 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/lint-and-test.yml` (+4 -0) 📝 `.gitignore` (+2 -2) 📝 `docs/CLAUDE.md` (+63 -81) 📝 `modules/interpreter.py` (+2 -0) ➕ `modules/tgwrapper.py` (+628 -0) 📝 `modules/validators.py` (+15 -0) 📝 `terravision/terravision.py` (+46 -3) ➕ `tests/fixtures/terragrunt-multi/app/main.tf` (+25 -0) ➕ `tests/fixtures/terragrunt-multi/app/terragrunt.hcl` (+40 -0) ➕ `tests/fixtures/terragrunt-multi/vpc/main.tf` (+24 -0) ➕ `tests/fixtures/terragrunt-multi/vpc/terragrunt.hcl` (+27 -0) ➕ `tests/fixtures/terragrunt-single/main.tf` (+7 -0) ➕ `tests/fixtures/terragrunt-single/terragrunt.hcl` (+27 -0) ➕ `tests/test_terragrunt_detection.py` (+76 -0) ➕ `tests/test_tgwrapper.py` (+462 -0) </details> ### 📄 Description ## Summary - Auto-detects Terragrunt sources via `terragrunt.hcl` presence — no new CLI flags - **Single-module**: delegates to `terragrunt init/plan/show/graph`, feeds into existing pipeline - **Multi-module**: discovers child modules, runs per-module plans, merges with `module.<name>.` prefixes, parses `dependency` blocks with python-hcl2 to inject cross-module edges into graphdict - Cross-module links discovered automatically by existing `add_relations()` code - Graceful degradation: HCL parse failures skip cross-module links with a warning, diagram still renders Resolves #114 ## Files Changed - `modules/tgwrapper.py` — new Terragrunt wrapper (detection, plan execution, merging, dependency parsing) - `modules/validators.py` — added `is_terragrunt_source()` API - `modules/interpreter.py` — guard for unknown module names in variable_map - `terravision/terravision.py` — Terragrunt detection branch in `compile_tfdata()` - `.github/workflows/lint-and-test.yml` — install Terragrunt on CI runners - Test fixtures + 33 new tests (25 unit + 8 detection) ## Test plan - [x] 340 tests pass locally (including 1 slow Terragrunt integration test) - [x] Zero regression in existing Terraform-only test suite - [ ] CI runners install Terragrunt and run all tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:38:06 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/terravision#189
No description provided.