
The Terraform Mistakes I Made So You Do Not Have To
The Terraform Mistakes I Made So You Do Not Have To I have been writing Terraform professionally for 4 years. I have also been making Terraform mistakes for 4 years. Here are the ones that actually cost me time, money, or sleep, and what I learned from each. Mistake 1: One Giant State File for Everything When I started, putting everything in one state file felt elegant. One source of truth. Simple to reason about. Then I made a mistake in one module and the entire state file became unusable during apply. Then two engineers tried to apply changes simultaneously and got state lock conflicts. Then the state file grew to 50MB and plans started taking 8 minutes. What I do now: one state file per service per environment. More overhead to set up, dramatically safer to operate. Mistake 2: Storing Secrets in Variables I know. Obviously bad. I still did it. The situation: I was moving fast on a new project, needed to pass a database password to the application config, thought I would fix this pr
Continue reading on Dev.to
Opens in a new tab

