Skip to content

Add Terragrunt support (single + multi-module)#180

Merged
patrickchugh merged 2 commits intomainfrom
008-terragrunt-support
Mar 29, 2026
Merged

Add Terragrunt support (single + multi-module)#180
patrickchugh merged 2 commits intomainfrom
008-terragrunt-support

Conversation

@patrickchugh
Copy link
Copy Markdown
Owner

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

patrickchugh and others added 2 commits March 29, 2026 10:09
Auto-detects Terragrunt sources via terragrunt.hcl presence. Single-module
delegates to terragrunt CLI for init/plan/show/graph. Multi-module discovers
child modules, runs per-module plans, merges with module.<name>. prefixes,
and parses dependency blocks with python-hcl2 to inject cross-module edges
into graphdict — existing add_relations() discovers them automatically.

Resolves #114

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@patrickchugh patrickchugh self-assigned this Mar 29, 2026
@patrickchugh patrickchugh merged commit b7b9e5d into main Mar 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] terragrunt support

1 participant