Hacker News new | ask | show | jobs
by flumpcakes 1111 days ago
How does this work? I thought the terraform state file was the single source of truth - if people are applying terraform 'manually' I assume that means on their local device? Are people sharing around the state file but don't have a central location for a lock file? Apologises if this seems obvious...
3 comments

My assumption is that they're still using a remote backend for state, but they haven't set it up to use the locking features of the backend.

For example, I've use S3 as my Terraform backend for years, but I've never bothered to set up the locking feature, which uses DynamoDB.

In a small team that deploys Terraform changes rarely, you may never encounter the problems solved by using locking. Maybe good communication and a Slack channel works well enough for you.

As others said, we checked the state file into git. It was up to you to ensure you pulled after taking a lock.
One can just commit the lock file to Git or use any backend (like S3, HTTP, ...) to share the lock file.