{
  "id": "terraform/variable-type-constraint-violation",
  "signature": "Error: Invalid value for variable: value must be a list of strings, got a string",
  "signature_zh": "错误：变量值无效：值必须是字符串列表，但得到的是字符串",
  "regex": "Invalid value for variable.*value must be a list of strings",
  "domain": "terraform",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "A variable defined with a list type constraint was provided with a single string value instead of a list.",
  "root_cause_type": "generic",
  "root_cause_zh": "定义为列表类型约束的变量被提供了单个字符串值而不是列表。",
  "versions": [
    {
      "version": "Terraform v1.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Terraform v1.6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Terraform v1.7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The single string does not satisfy the list(type = list(string)) constraint.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Environment variables are always interpreted as strings, not lists.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Other parts of the configuration likely use for_each or other list-specific functions.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "In .tfvars file, use list syntax: 'variable_name = [\"value1\", \"value2\"]'.",
      "success_rate": 0.95,
      "how": "In .tfvars file, use list syntax: 'variable_name = [\"value1\", \"value2\"]'.",
      "condition": "",
      "sources": []
    },
    {
      "action": "For environment variables, use JSON encoding: 'export TF_VAR_variable_name='[\"value1\",\"value2\"]''.",
      "success_rate": 0.9,
      "how": "For environment variables, use JSON encoding: 'export TF_VAR_variable_name='[\"value1\",\"value2\"]''.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using -var flag: 'terraform apply -var='variable_name=[\"value\"]''.",
      "success_rate": 0.85,
      "how": "If using -var flag: 'terraform apply -var='variable_name=[\"value\"]''.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在 .tfvars 文件中，使用列表语法：'variable_name = [\"value1\", \"value2\"]'。",
    "对于环境变量，使用 JSON 编码：'export TF_VAR_variable_name='[\"value1\",\"value2\"]''。",
    "如果使用 -var 标志：'terraform apply -var='variable_name=[\"value\"]''。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.hashicorp.com/terraform/language/values/variables#type-constraints",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-12-01",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}