# Error: Error acquiring the state lock: ResourceNotFoundException: Requested resource not found

- **ID:** `terraform/state-lock-dynamodb-table-not-found`
- **Domain:** terraform
- **Category:** resource_error
- **Error Code:** `ResourceNotFoundException`
- **Verification:** ai_generated
- **Fix Rate:** 92%

## Root Cause

The DynamoDB table specified for state locking does not exist in the AWS account or region, preventing lock acquisition.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.3.0 | active | — | — |
| 1.4.0 | active | — | — |
| 1.5.0 | active | — | — |

## Workarounds

1. **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** (95% success)
   ```
   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
   ```
2. **Use Terraform itself to create the DynamoDB table in a separate configuration, then migrate the backend.** (85% success)
   ```
   Use Terraform itself to create the DynamoDB table in a separate configuration, then migrate the backend.
   ```

## Dead Ends

- **** — Running terraform init again does not create the DynamoDB table; it only configures the backend. (95% fail)
- **** — 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. (60% fail)
