Terragrunt
$ terragrunt Official High RiskTerragrunt (terragrunt) wraps Terraform and OpenTofu to keep remote state, provider blocks, and multi-module dependency graphs DRY via terragrunt.hcl. It supports --non-interactive (TG_NON_INTERACTIVE=true), terragrunt find --format json, --json-log, and run --all plan dry previews before applying.
brew install terragrunt terragrunt executes DAG-ordered plan and find --format json across local HCL modules directly; MCP cannot replace local state/provider auth.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Provides --non-interactive, --json-log, and find --format json, and forwards -json to underlying output/show commands.
--non-interactive(TG_NON_INTERACTIVE=true) prevents stdin hangsterragrunt find --format jsonand--json-logemit structured JSON
plan provides reliable dry-run diffs, but run --all apply/destroy can mutate or tear down production cloud infrastructure across many modules at once.
planpreviews exact resource additions, changes, and deletionsrun --allblast radius spans entire multi-account/multi-module stacks
Single static Go binary via Homebrew and GitHub Releases across macOS, Linux, and Windows, requiring terraform or tofu installed.
- Cross-platform binary via
brew install terragrunt; requiresterraformortofu
Standardizes remote state, dependency ordering, and DRY HCL orchestration across large Terraform/OpenTofu repos.
- Orchestrates multi-module dependency DAGs with
run --all
Official Gruntwork project (gruntwork-io/terragrunt) licensed under MIT.
- Official
gruntwork-io/terragruntrepository
Extensive reference documentation at terragrunt.gruntwork.io covering the modernized CLI redesign.
- Official CLI reference at terragrunt.gruntwork.io
Security, Auth & Guardrails
Inherits cloud provider credentials (AWS, GCP, Azure env vars/profiles) and remote state backend auth configured in terragrunt.hcl.
CLI is MIT open-source and free; provisioned cloud infrastructure incurs cloud provider billing.
# Terragrunt Agent Rules - Always run `terragrunt find --format json` and `terragrunt plan --non-interactive` before any `apply`. - NEVER run `terragrunt run --all apply` or `terragrunt destroy` without explicit user confirmation of the full plan diff, as changes incur real cloud billing and outage risk.
Agent-Ready Command Recipes
Safe Read-Only Queries
terragrunt find --format json
Lists discovered terragrunt.hcl units and stack structure as JSON without running Terraform.
terragrunt run --all --non-interactive plan
Computes execution plans across dependent modules without applying infrastructure changes.
Controlled Writes & Previews
terragrunt apply --non-interactive -auto-approve
Applies changes to the targeted single unit only; prefer targeted apply over run --all apply in agent runs.
Strengths for Agents
- +
--non-interactiveandfind --format jsonmake multi-module discovery and CI automation clean. - +
run --all planpreviews cross-module dependency diffs before touching cloud resources. - + Works seamlessly with both Terraform and OpenTofu binaries.
Caveats & Pitfalls
- !
run --all applyordestroycarries a massive multi-module blast radius and real cloud billing impact. - ! Flag syntax evolved during the CLI redesign (legacy
--terragrunt-*flags vs modern flags).