{
  "id": "terraform/resource-in-config-no-longer-exists",
  "signature": "Error: Resource instance has been removed from the configuration but is still tracked in the state",
  "signature_zh": "错误：资源实例已从配置中移除，但仍在状态文件中跟踪",
  "regex": "Resource instance has been removed from the configuration but is still tracked in the state",
  "domain": "terraform",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "A resource was removed from the .tf configuration file but Terraform still has it in the state, causing a plan to destroy it unexpectedly.",
  "root_cause_type": "generic",
  "root_cause_zh": "从 .tf 配置文件中移除了某个资源，但 Terraform 状态中仍存在该资源记录，导致计划意外地要销毁它。",
  "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 apply will execute the destroy, removing the resource permanently.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Manual edits often break state file format or leave orphaned dependencies.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Terraform will try to create a new resource, conflicting with the existing state entry.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Run 'terraform state rm <resource_address>' to remove the resource from state without destroying it, then run 'terraform apply' to sync.",
      "success_rate": 0.95,
      "how": "Run 'terraform state rm <resource_address>' to remove the resource from state without destroying it, then run 'terraform apply' to sync.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If you want to destroy the resource, run 'terraform apply' directly after verifying the plan shows the intended destroy.",
      "success_rate": 0.9,
      "how": "If you want to destroy the resource, run 'terraform apply' directly after verifying the plan shows the intended destroy.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use 'terraform state list' to identify the full resource address, then 'terraform state rm <address>'.",
      "success_rate": 0.85,
      "how": "Use 'terraform state list' to identify the full resource address, then 'terraform state rm <address>'.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "运行 'terraform state rm <资源地址>' 从状态中移除资源而不销毁它，然后运行 'terraform apply' 同步。",
    "如果希望销毁该资源，在验证计划显示预期销毁后直接运行 'terraform apply'。",
    "使用 'terraform state list' 识别完整资源地址，然后运行 'terraform state rm <地址>'。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.hashicorp.com/terraform/language/state/import",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2023-11-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}