How do you move from DynamoDB locking to S3 native locking in a live fleet?
IntermediateProductionState and Backends in Production
Answer
- Upgrade every CI runner and laptop to Terraform 1.10 or newer (1.11+ preferred, where it is stable).
- Add
use_lockfile = truewhile keepingdynamodb_table, so both mechanisms lock during the transition. - Run
terraform init -reconfigureper stack and confirm a plan acquires the lock. - Grant
DeleteObjecton the.tflockkey. - Remove
dynamodb_tableand later the table itself.
More on State and Backends in Production
Why should Terraform state never be committed to Git?BeginnerHow do you bootstrap the remote backend, given the bucket must exist before Terraform can use it?IntermediateWhat does a hardened S3 state bucket look like?IntermediateWhat is the minimum IAM permission set for the S3 backend?IntermediateState was deleted or corrupted. How do you recover?AdvancedHow do you split a monolithic state and what drives blast-radius decisions?Advanced