# Error: Error acquiring the state lock: ConditionalCheckFailedException: The conditional request failed: ProvisionedThroughputExceededException: Rate exceeded

- **ID:** `terraform/state-lock-dynamodb-throttling`
- **Domain:** terraform
- **Category:** resource_error
- **Error Code:** `ProvisionedThroughputExceededException`
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

DynamoDB table used for state locking is experiencing throttling due to high request rates, exceeding its provisioned read/write capacity.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Terraform 1.5.0 | active | — | — |
| Terraform 1.6.0 | active | — | — |
| Terraform 1.7.0 | active | — | — |

## Workarounds

1. **Increase the DynamoDB table's provisioned read and write capacity units (RCU/WCU) to handle the peak load. Switch to on-demand capacity if workload is unpredictable.** (85% success)
   ```
   Increase the DynamoDB table's provisioned read and write capacity units (RCU/WCU) to handle the peak load. Switch to on-demand capacity if workload is unpredictable.
   ```
2. **Implement client-side retry logic by wrapping terraform commands in a bash script with exponential backoff.** (75% success)
   ```
   Implement client-side retry logic by wrapping terraform commands in a bash script with exponential backoff.
   ```
3. **Reduce the frequency of terraform apply/plan operations during peak hours, or stagger multiple CI/CD pipelines to avoid concurrent lock attempts.** (70% success)
   ```
   Reduce the frequency of terraform apply/plan operations during peak hours, or stagger multiple CI/CD pipelines to avoid concurrent lock attempts.
   ```

## Dead Ends

- **** — The lock acquisition failed due to throttling, not because the lock is held. Force-unlock doesn't address the throughput issue. (90% fail)
- **** — Deleting the table removes all state lock items but also any existing locks. Recreating with default settings still has low throughput. (80% fail)
- **** — Terraform's retry mechanism is for provider operations, not for state lock acquisition. The lock mechanism is internal and not configurable. (95% fail)
