3 ms·
Where do you store your state files? The only project I've worked on that used Terraform stored state in a git repo, which seemed like a nightmare with multiple
by nineteen999 7y ago
Where do you store your state files? The only project I've worked on that used Terraform stored state in a git repo, which seemed like a nightmare with multiple people doing deploys to the same environment. Others have suggested it would be better stored on a network accessible share.
- 0xEFF 7y agoStore them in a bucket as soon as possible.
- bbatha 7y agoUsually your favorite S3 like service. Do most of your development in modules then have “roots” that cover a well defined subsets of your infrastructure (say db, app servers, load balancer and firewall rules for a single app) then use workspaces to manage different environments. The docs for terraform are actually quiet.
- haney 7y agoI use a versioned S3 bucket to store state in my project, terraform also supports "locks" to avoid race conditions/parallel execution. I've set up buildkite to run `terraform plan` and then if the output looks I can approve the next step to run `terraform apply`. Atlantis (https://github.com/runatlantis/atlantis https://github.com/runatlantis/atlantis) is also a really cool project for managing teams working on terraform projects.
- pensatoio 7y agoPersonally, my team uses S3 to store state paired with DynamoDB to manage state locks. Translation, when someone applies a layer a remote lock is created for the duration of their interaction. It’s a fantastic system. I imagine using git to store state would be mightily inconvenient.