{
  "slug": "terragrunt-stack-dependencies-supports-cross-stack-dependency-patterns-3f8e54636763",
  "title": "terragrunt stack-dependencies supports cross-stack dependency patterns",
  "tools": [
    "terragrunt"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-04-21T12:24:34.000Z",
  "announced_at": "2026-04-21T12:24:34.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When a stack needs dependencies on another stack or a unit in a nested stack, declare them in `autoinclude` in `terragrunt.stack.hcl` using stack paths and dependency outputs. Plan all units with the `stack-dependencies` experiment enabled.",
    "examples": [
      "stack \"infra\" {\n  source = \"<stack-source>\"\n  path   = \"infra\"\n}\n\nunit \"app\" {\n  source = \"<unit-source>\"\n  path   = \"app\"\n\n  autoinclude {\n    dependency \"infra\" {\n      config_path = stack.infra.path\n    }\n    inputs = {\n      vpc_id = dependency.infra.outputs.vpc.vpc_id\n    }\n  }\n}",
      "stack \"networking\" {\n  source = \"<stack-source>\"\n  path   = \"networking\"\n}\n\nunit \"app\" {\n  source = \"<unit-source>\"\n  path   = \"app\"\n\n  autoinclude {\n    dependency \"vpc\" {\n      config_path = stack.networking.vpc.path\n    }\n    inputs = {\n      vpc_id = dependency.vpc.outputs.vpc_id\n    }\n  }\n}",
      "terragrunt run --all --experiment stack-dependencies -- plan"
    ],
    "gotchas": [
      "Version: v1.0.2",
      "Availability: The `stack-dependencies` experiment.",
      "stack.<name>.path (required): Path reference for depending on the whole named stack.",
      "stack.<name>.<unit_name>.path (required): Path reference for depending on a unit within a nested stack.",
      "dependency.<name>.config_path (required): Path to the dependency configuration; examples set it to a stack path reference.",
      "dependency.<name>.outputs.<unit_name>.<output_key>: Access an output from a unit through a dependency targeting a stack directory; use the dependent stack's name and the unit/output names.",
      "--all: Run the specified OpenTofu/Terraform command against all units in the current stack.",
      "--experiment stack-dependencies (required): Enables the stack-dependencies experiment for the command.",
      "plan (required): OpenTofu/Terraform command passed to `terragrunt run`.",
      "Prerequisite: Enable the `stack-dependencies` experiment for the run with `--experiment stack-dependencies`.",
      "Prerequisite: The stack and unit declarations, including their `source` and `path`, belong in `terragrunt.stack.hcl`; `autoinclude` is nested in the unit or stack declaration."
    ]
  },
  "why_it_matters": "Configure a Terragrunt stack so units can depend on another stack or on a unit in a nested stack.",
  "before": "Before stack dependencies, stacks passed dependency paths to units through `values`, and units declared `dependency` blocks using those values as `config_path`.",
  "sources": [
    "https://github.com/gruntwork-io/terragrunt/releases/tag/v1.0.2",
    "https://docs.terragrunt.com/reference/cli/commands/run/",
    "https://github.com/gruntwork-io/terragrunt-infrastructure-catalog-example/blob/main/docs/1.1-migration-guide.md"
  ],
  "rank": 0.96043,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2a-20261017",
    "verdict_id": "wave2a-20261017:wave2a-20261017-38f7cf80f48ff31e-1:gate",
    "evidence_hash": "7237c48131f4b279f08ad289985fad7d29fa94fb1079e7e3e1c3d922b6234284"
  },
  "review": {
    "draft_hash": "23fdf207546dc7677a8ccc226f59775dd0596789fb45b0dd561ce7b3d78bf9bc",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2a-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.96 >= 0.9; 2 needed) and Jev gave 0.69 (>= 0.6 needed)."
  }
}
