Interview Prep/Terraform/State Locking and Backend Errors

After upgrading to Terraform 1.11 you see `Warning: Deprecated Parameter` for `dynamodb_table`. On an older laptop `use_lockfile` gives `An argument named "use_lockfile" is not expected here`.

IntermediateTroubleshootingState Locking and Backend Errors
Answer

Likely causes → DynamoDB locking is deprecated in favour of S3-native locking. use_lockfile was added in 1.10, so older binaries reject it.

Diagnose → terraform version on each machine and CI image; check required_version.

Fix → Standardize on 1.10+ everywhere, then migrate in two steps: set both use_lockfile = true and dynamodb_table (both locks are taken), roll out, then remove dynamodb_table.

Prevent → Pin required_version = ">= 1.10, < 2.0" and the CI image version, and use tfenv/mise with a .terraform-version file.

All Terraform questions Roadmap: Terraform in production

More on State Locking and Backend Errors