{
  "slug": "terraform-provider-requirements-accept-const-variables-and-locals-01a1205b019d",
  "title": "Terraform provider requirements accept const variables and locals",
  "tools": [
    "terraform"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-10-21T17:32:54.000Z",
  "announced_at": "2026-10-21T17:32:54.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When provider source or version requirements need values supplied as constants or locals, reference them in `required_providers`; keep variable values independent of dynamic plan results. Supply const-variable values at plan time with supported methods such as `-var`, `-var-file`, or environment variables.",
    "examples": [
      "terraform {\n  required_providers {\n    random = {\n      source  = \"app.terraform.io/${var.organization}/random\"\n      version = local.random_version\n    }\n  }\n}\n\nvariable \"organization\" {\n  type  = string\n  const = true\n}\n\nlocals {\n  random_version = \"3.9.0\"\n}",
      "terraform init"
    ],
    "gotchas": [
      "Version: 1.17.0",
      "required_providers.<LOCAL_NAME>.source (required): Provider source address; may reference a const variable.",
      "required_providers.<LOCAL_NAME>.version: Provider version constraint; may reference a const variable or local.",
      "variable.<NAME>.const: Set to `true` for an input variable used in provider requirements.",
      "-var=<NAME>=<VALUE>: Set an input variable value on the command line.",
      "-var-file=<FILE>: Load input variable values from a file.",
      "TF_VAR_<NAME>: Set an input variable through an environment variable.",
      "Prerequisite: Terraform v1.17.0 or later is required for the feature described in the release note.",
      "Prerequisite: Variables used in provider requirements must be declared `const = true`; provide their values using a method supported during plan.",
      "Prerequisite: Values cannot depend on dynamic results from a plan step.",
      "Values can't depend on any dynamic results from a plan step."
    ]
  },
  "why_it_matters": "Configure provider requirements with organization or version values supplied as constants or locals.",
  "sources": [
    "https://github.com/hashicorp/terraform/releases/tag/v1.17.0",
    "https://github.com/hashicorp/terraform/pull/39153",
    "https://developer.hashicorp.com/terraform/cli/commands/init",
    "https://developer.hashicorp.com/terraform/language/providers/requirements",
    "https://developer.hashicorp.com/terraform/cli/commands/plan",
    "https://developer.hashicorp.com/terraform/language/values/variables"
  ],
  "rank": 0.97039,
  "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": "daily-20261026-04",
    "verdict_id": "daily-20261026-04:daily-20261026-04-4b04a7d6da6bcdad-0:gate",
    "evidence_hash": "7a16a5e33fef2336f5067cb2d401a27bbd959e2cca68ac70b01385fb29ae7447"
  },
  "review": {
    "draft_hash": "17217f800a581da07350bd02fe034ef120a76ecdd5c953ffe8c1a0a68ab5b2e3",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-21T17:32:54.000Z",
    "decision": "daily-20261026-04:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.97 >= 0.9; 2 needed) and Jev gave 0.73 (>= 0.6 needed)."
  }
}
