4 ms·
Terraform has to have state, for the reasons outlined by other commenters. But, it is undoubtedly a pain in the arse in practice - invariably someone else is d
by tragomaskhalos 4y ago
Terraform has to have state, for the reasons outlined by other commenters.
But, it is undoubtedly a pain in the arse in practice - invariably someone else is doing a change on a branch but has already applied it to the development infra using the shared state bucket, which then pollutes it for everyone else as you don't have those changes so your applys will now want to undo them.
As a first timer with this stuff, I think a key lesson learned is to balkanise your terraform quite heavily - we have a tfstate per environment but that is nowhere near granular enough, slicing it into smaller pieces would obviate many of those 'pollution' problems.
- ciceryadam 4y agoWe use a single a single tf state per Google project. Instead of slicing up the state into multiple substates, we use modules as much as possible, and use "-target=module.module_name" to test our branches.