Warning: Deprecated Parameter: "dynamodb_table" is deprecated, use "use_lockfile" instead
Fixes the S3 backend deprecation warning for dynamodb_table: AWS provider 5.100+ wants use_lockfile = true (S3-native locking, Terraform 1.10+) instead of a DynamoDB lock table. Use when plan warns the parameter is deprecated. Switch the backend block and reconfigure; not for ConditionalCheckFailedException lock errors.
TL;DR
dynamodb_table in the S3 backend is deprecated (AWS provider 5.100+). The replacement is S3-native locking: use_lockfile = true in the backend block, which needs Terraform 1.10+. Make the switch, run terraform init -reconfigure, and you can drop the DynamoDB table.
The warning
Warning: Deprecated Parameter
The parameter "dynamodb_table" is deprecated. Use parameter "use_lockfile" instead.Steps to fix
- Confirm your Terraform version is 1.10+ (
terraform version);use_lockfiledoes not exist earlier.
- Expected: version requirement met, or upgrade first.
- Update the backend block:
backend "s3" {
bucket = "llmops-bedrock-tfstate"
key [your value]
region = "us-east-1"
use_lockfile = true
encrypt = true
}- Expected: no
dynamodb_tableremains.
- Run
terraform init -reconfigure.
- Expected: init succeeds; locking now uses a
.tflockobject in S3.
- After confirming applies lock correctly, decommission the DynamoDB table.
- Expected: one less resource to manage, warning gone.
When to use this
terraform init/planprints thedynamodb_tabledeprecation warning on AWS provider 5.100+.
When NOT to use this
- Actual lock failures (
ConditionalCheckFailedException) are operational, not deprecation, and are fixed by unlocking, not by migrating. Do not migrate mid-incident.
Compatibility
use_lockfile: Terraform 1.10+, AWS provider 5.100+. Older setups keepdynamodb_tablewith no warning.
Root cause
S3 now supports conditional writes, so Terraform can implement locking with a lockfile object in the bucket itself. The provider deprecated the DynamoDB path to consolidate on the simpler mechanism.
Edge cases
- Both set:
use_lockfilewins; removedynamodb_tableto silence the warning. - Cross-account state buckets need the caller's S3 permissions to include the lockfile object operations.
- Teams pinned to Terraform < 1.10 must stay on
dynamodb_tableand accept the warning (or upgrade Terraform).