{
  "id": "terraform/provider-inconsistent-result-after-apply",
  "signature": "Error: Provider produced inconsistent result after apply: After applying!terraform!plan, the provider returned a value for \"instance_type\" that was not in the plan: \"t2.micro\" -> \"t3.micro\"",
  "signature_zh": "错误：Provider 在 apply 后产生不一致的结果：在应用 terraform plan 后，provider 返回的 \"instance_type\" 值不在计划中：\"t2.micro\" -> \"t3.micro\"",
  "regex": "Error: Provider produced inconsistent result after apply: After applying!terraform!plan, the provider returned a value for \".*\" that was not in the plan: \".*\" -> \".*\"",
  "domain": "terraform",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The provider modified a resource attribute during creation/update that Terraform did not expect, often due to AWS defaulting or auto-converting instance types (e.g., t2.micro to t3.micro in certain regions).",
  "root_cause_type": "generic",
  "root_cause_zh": "Provider 在创建/更新期间修改了 Terraform 未预期的资源属性，通常是由于 AWS 默认或自动转换实例类型（例如在某些区域 t2.micro 变为 t3.micro）。",
  "versions": [
    {
      "version": "Terraform v1.5",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Terraform v1.6",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "AWS Provider v5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "AWS Provider v4.67",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "State files should not be manually edited; it can cause drift, corruption, and is not idempotent. Terraform will detect the edit and may error on next plan.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This prevents Terraform from detecting future changes to instance_type, masking the issue and allowing drift to go unnoticed.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Older providers may have the same issue or other bugs; it also prevents using new features and security fixes.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Update the configuration to explicitly set the attribute to the value the provider expects. For example, change 'instance_type = \"t2.micro\"' to 'instance_type = \"t3.micro\"' in the resource block, then run 'terraform apply' again.",
      "success_rate": 0.85,
      "how": "Update the configuration to explicitly set the attribute to the value the provider expects. For example, change 'instance_type = \"t2.micro\"' to 'instance_type = \"t3.micro\"' in the resource block, then run 'terraform apply' again.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the attribute is not critical, use lifecycle.ignore_changes with caution. Add 'lifecycle { ignore_changes = [instance_type] }' to the resource, then run 'terraform apply' to accept the current state. Example: resource \"aws_instance\" \"example\" { ami = \"ami-abc123\" instance_type = \"t2.micro\" lifecycle { ignore_changes = [instance_type] } }",
      "success_rate": 0.7,
      "how": "If the attribute is not critical, use lifecycle.ignore_changes with caution. Add 'lifecycle { ignore_changes = [instance_type] }' to the resource, then run 'terraform apply' to accept the current state. Example: resource \"aws_instance\" \"example\" { ami = \"ami-abc123\" instance_type = \"t2.micro\" lifecycle { ignore_changes = [instance_type] } }",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Update the configuration to explicitly set the attribute to the value the provider expects. For example, change 'instance_type = \"t2.micro\"' to 'instance_type = \"t3.micro\"' in the resource block, then run 'terraform apply' again.",
    "If the attribute is not critical, use lifecycle.ignore_changes with caution. Add 'lifecycle { ignore_changes = [instance_type] }' to the resource, then run 'terraform apply' to accept the current state. Example: resource \"aws_instance\" \"example\" { ami = \"ami-abc123\" instance_type = \"t2.micro\" lifecycle { ignore_changes = [instance_type] } }"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.hashicorp.com/terraform/language/resources/behavior#inconsistent-results",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2023-10-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}