---
title: "Discussion on \"Terraform S3 backend state locking: use_lockfile, DynamoDB deprecation and the backend key collision that overwrites your state\" | Hashnode"
description: "Discussion on \"Terraform S3 backend state locking: use_lockfile, DynamoDB deprecation and the backend key collision that overwrites your state\". Two root modules with the same bucket and key take turns overwriting one state file, and nothing turns red. Here is what the Terraform and OpenTofu docs actually say about S3 state locking, credentials and local state, the seven backend mistakes I keep finding, and StateLock, a free VS Code extension that checks every state backend in your repo."
url: "https://hashnode.com/posts/slug-statelock-terraform-state-lock-s3-backend-key-collision/6b10530d2356d174e43a7625"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Terraform S3 backend state locking: use\_lockfile, DynamoDB deprecation and the backend key collision that overwrites your state](https://jaytank.hashnode.dev/slug-statelock-terraform-state-lock-s3-backend-key-collision?utm_source=hashnode&utm_medium=feed)

Two root modules with the same bucket and key take turns overwriting one state file, and nothing turns red. Here is what the Terraform and OpenTofu docs actually say about S3 state locking, credentials and local state, the seven backend mistakes I keep finding, and StateLock, a free VS Code extension that checks every state backend in your repo.

17h ago · 11 min read · jaytank.hashnode.dev  
Read the article

-   [#terraform](https://hashnode.com/tag/terraform)
-   [#devops](https://hashnode.com/tag/devops)
-   [#aws](https://hashnode.com/tag/aws)
-   [#vs-code](https://hashnode.com/tag/vs-code)
-   [#infrastructure-as-code](https://hashnode.com/tag/infrastructure-as-code)

## Written by

[JAY TANK](https://hashnode.com/@jaytank)

@jaytank

  
[View profile](https://hashnode.com/@jaytank)

Engineering insights on building and scaling modern software.

Cloud &amp; Platform Engineer focused on building systems that scale and endure. I explore how infrastructure, automation, and engineering practices come together to support modern software teams.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
