HeadlinesBriefing favicon HeadlinesBriefing.com

Terraform 1.9 S3 Native State Locking

DEV Community •
×

Terraform 1.9+ now supports S3 native state locking, eliminating the need for a separate DynamoDB table. This built-in mechanism uses a `.tflock` file in your S3 bucket to manage concurrency safely. Teams can now manage remote state with a single AWS resource instead of two, cutting costs and complexity.

For years, the standard S3 backend required a dedicated DynamoDB table for locking, adding ~$0.25/month in minimum costs and extra IAM permissions. This setup also risked lock table drift if the DynamoDB resource was deleted. The new `use_lockfile = true` configuration streamlines this, using S3's atomic operations for the same safety guarantees.

Migration is straightforward: upgrade to Terraform 1.9+, update your backend config, run `terraform init -migrate-state`, and delete the old DynamoDB table. The result is identical locking behavior with one fewer resource to manage. For production teams with hundreds of state files, this simplifies infrastructure and reduces the potential for configuration drift.