Hi Terraform experts,
Our team just started to use Terraform Cloud to manage our product and we would like to get some advice on how workspaces should be organized.
Our product consists of 3 micro services. Currently in each deploy environment, we have 3 workspaces roughly one for each micro service. The following graph shows the structure:
As you can see, each workspace is relatively self contained and there’s not much dependency among workspaces.
Another approach we are thinking of is to extract some of the resources out into their own workspaces, for example:
- DB resources – they are critical and change less frequent, putting it together with other resources with more frequent changes in the same workspace adds the chance of misconfiguration
- VPC resources – they usually affects multiple services, putting it under one service workspace may be hard to manage in the future.
So the structure of this approach will look like the following graph:
I feel this will give us better isolation and easier management but it adds more dependencies among workspaces and we have the concern misconfiguration will be harder to detect – resources dependencies misconfiguration within a workspace can be easily detected at plan stage.
I’m wondering if there’s any general best practice on how workspaces should be structured? Thanks in advance!
Best,
Junfeng