4 ms·
Despite its other quirks and pain points, I feel that AWS CloudFormation does a better job of separating the ideas of a set of desired resources (Templates) and
by zdc1 3y ago
Despite its other quirks and pain points, I feel that AWS CloudFormation does a better job of separating the ideas of a set of desired resources (Templates) and their deployed instances (Stacks).
I've seen a lot of Terraform best-practices guides for project organisation that are a mess of nested folders for environments and modules, with boilerplate provider and backend configuration in each of them. The built-in solution (Workspaces) can also be helpful, but doesn't work in contexts where deeper segregation between environments is required.
My personal approach to living happily with Terraform is to have a set of standard root modules (network, db, etc.) and have a wrapper like Ansible that generates the backend configuration on-the-fly for whatever environment is being targeted. I'd also have it load variables from a central configuration store and expose them as TF_VAR_... so a standard set of variables is always available.