{
  "id": "terraform/invalid-interpolation-in-variable-default",
  "signature": "Error: Invalid interpolation in variable default: Variables may not be used here",
  "signature_zh": "错误：变量默认值中存在无效插值：此处不能使用变量",
  "regex": "Invalid interpolation in variable default",
  "domain": "terraform",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Terraform variables cannot reference other variables in their default values; defaults must be literal values.",
  "root_cause_type": "generic",
  "root_cause_zh": "Terraform 变量在其默认值中不能引用其他变量，默认值必须是字面值。",
  "versions": [
    {
      "version": "1.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Adding escape characters or quotes around the interpolation does not resolve the fundamental limitation.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Moving the interpolation to a locals block still fails because the variable default is evaluated before locals are available.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Replace the variable reference with a literal value, or use a local value to compute the default after variable declaration.",
      "success_rate": 0.95,
      "how": "Replace the variable reference with a literal value, or use a local value to compute the default after variable declaration.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Define a separate variable with no default and use a locals block to set the default based on other variables.",
      "success_rate": 0.9,
      "how": "Define a separate variable with no default and use a locals block to set the default based on other variables.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "将变量引用替换为字面值，或使用 local 值在变量声明后计算默认值。",
    "定义一个无默认值的单独变量，并使用 locals 块根据其他变量设置默认值。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.hashicorp.com/terraform/language/values/variables",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-08-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}