{
  "slug": "terraform-console-accepts-a-module-scope-4f6d5af24b07",
  "title": "terraform console accepts a module scope",
  "tools": [
    "terraform"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-08-26T13:05:28.000Z",
  "announced_at": "2026-08-26T13:05:28.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When you need to evaluate an expression in a child module, run `terraform console` with `-scope` set to that module’s address. Add an index or key for a specific `count` or `for_each` instance.",
    "examples": [
      "printf '%s\\n' '<expression>' | terraform console -scope='module.<name>'",
      "printf '%s\\n' '<expression>' | terraform console -scope='module.<name>[0]'",
      "printf '%s\\n' '<expression>' | terraform console -scope='module.<name>[\"<key>\"]'"
    ],
    "gotchas": [
      "Version: 1.16.0",
      "-scope=<module address>: Selects the module scope for expression evaluation; omit to use the root module. Use a module address, with an index for `count` instances or a key for `for_each` instances.",
      "Prerequisite: Terraform v1.16.0 or later for this flag, introduced in v1.16.0.",
      "Prerequisite: The selected child module must be present in the configuration; instance addresses use an index for `count` or a key for `for_each`.",
      "The module scope is specified as a module address; the flag is optional."
    ]
  },
  "why_it_matters": "Evaluate a Terraform expression in the context of a module or module instance.",
  "before": "The console evaluated expressions in the root module by default.",
  "sources": [
    "https://github.com/hashicorp/terraform/releases/tag/v1.16.0",
    "https://developer.hashicorp.com/terraform/cli/commands/console"
  ],
  "rank": 0.95028,
  "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": "wave1-20261014",
    "verdict_id": "wave1-20261014:wave1-20261014-9dc08c468cba15fd-15:gate",
    "evidence_hash": "edbcce37ed584b98c62b355d002c0d3b4113bdda32ce587492d2e3b0ef20cd0a"
  },
  "review": {
    "draft_hash": "5cd775e6d74a7ce993025227604b8fcea451524a955a61c3b33a0df85b30af83",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave1-20261014:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.95 >= 0.9; 2 needed) and Jev gave 0.61 (>= 0.6 needed)."
  }
}
