3 ms·
> Other teams use a folder structure to maintain separate projects for each environment. They copy and edit code between projects to make changes across environ
by andrekandre 5y ago
> Other teams use a folder structure to maintain separate projects for each environment. They copy and edit code between projects to make changes across environments.
if i'm reading this right, they're not saying different folders with only the diffs (config files, test classes, dummy data, etc) but actually full-on copies of the whole entire project?
- 3np 5y agoYeah, it was a common pattern especially in older TF repositories from before workspaces had better support. It takes quite a bit of discipline (and balance; sometimes the effort to make it “right” is not well-spent) to not end up in a mess when your infrastructure starts to scale across regions and providers.
- 0x202020 5y agoTo get around the separate directories/copies someone established a pattern of doing a for each environment at the top of each tf file and then all variables are stored as a map of each env, which I find interesting. The pattern exists in one repo with the other being all the duplicates, they’ve been in “it just works” for long enough that no one has changed them. Workspaces look pretty slick, I’ll have to check them out
- edgan 5y agoI would say it is still a common pattern. I don't see how workspaces really improves anything. The fundamental problem with Terraform is it lacks if statements. There are solutions that involve dynamic blocks and for_each, but I don't think they completely solve the problem. I would say they don't have great readability. I would love to hear a reasonable way to not snowflake that doesn't dive down the dynamic hole. Overall I think this is all an argument for Pulumi over Terraform.