{
  "id": "terraform/state-lock-dynamodb-table-not-found",
  "signature": "Error: Error acquiring the state lock: ResourceNotFoundException: Requested resource not found",
  "signature_zh": "错误：获取状态锁时出错：ResourceNotFoundException：请求的资源未找到",
  "regex": "Error acquiring the state lock|ResourceNotFoundException",
  "domain": "terraform",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "The DynamoDB table specified for state locking does not exist in the AWS account or region, preventing lock acquisition.",
  "root_cause_type": "generic",
  "root_cause_zh": "为状态锁定指定的 DynamoDB 表在 AWS 账户或区域中不存在，阻止了锁的获取。",
  "versions": [
    {
      "version": "1.3.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.4.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Running terraform init again does not create the DynamoDB table; it only configures the backend.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Setting the lock table to an empty string or removing it from the backend config causes Terraform to skip locking, but this can lead to state corruption.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Create the DynamoDB table manually using AWS CLI: aws dynamodb create-table --table-name terraform-lock --attribute-definitions AttributeName=LockID,AttributeType=S --key-schema AttributeName=LockID,KeyType=HASH --billing-mode PAY_PER_REQUEST",
      "success_rate": 0.95,
      "how": "Create the DynamoDB table manually using AWS CLI: aws dynamodb create-table --table-name terraform-lock --attribute-definitions AttributeName=LockID,AttributeType=S --key-schema AttributeName=LockID,KeyType=HASH --billing-mode PAY_PER_REQUEST",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use Terraform itself to create the DynamoDB table in a separate configuration, then migrate the backend.",
      "success_rate": 0.85,
      "how": "Use Terraform itself to create the DynamoDB table in a separate configuration, then migrate the backend.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "使用 AWS CLI 手动创建 DynamoDB 表：aws dynamodb create-table --table-name terraform-lock --attribute-definitions AttributeName=LockID,AttributeType=S --key-schema AttributeName=LockID,KeyType=HASH --billing-mode PAY_PER_REQUEST",
    "在单独的配置中使用 Terraform 创建 DynamoDB 表，然后迁移后端。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.hashicorp.com/terraform/language/settings/backends/s3#dynamodb-state-locking",
  "official_doc_section": null,
  "error_code": "ResourceNotFoundException",
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.92,
  "resolvable": "true",
  "first_seen": "2023-07-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}