Copy a Terraform root module to start a new one, trim the backend block, and forget to change key . A made-up but very typical example:
# app/backend.tf, copied from network/backend.tf backend "s3" { bucket = "acme-tf-state" key = "terraform.tfstate" # same key as network/ region = "eu-west-1" }
Enter fullscreen mode
Exit fullscreen mode
Both modules now write s3://acme-tf-state/terraform.tfstate . The next apply in one replaces the other's state, and the next plan in the other proposes to recreate everything it manages. Terraform never complains: it is a valid configuration.
What the docs actually say
S3 state locking is opt-in . use_lockfile defaults to false .
Terraform introduced use_lockfile as experimental in 1.10, made it generally available in 1.11, and deprecated dynamodb_table , which "will be removed in a future minor version".…