Since I am still very new with Terraform and have written up a my own Terraform template to provision a VM from a Packer image, I am now looking for a more standard and better structure/ way to achieve something bigger like provisioning a complete multi-tier environment with different boxes connecting with each other. I hope you guys could give me some suggestions or recommendations on this.
What is the best practice in the below context for Terraform?
The context:
I want to provision a multi-tier environment with the below specifications. An environment consists of 2 groups that can talk to each other via the load balancer in app tier.
Group A
2 VMs connecting to a load balancer 1 (App)
2 VMs connecting to a load balancer 2 (Web)
1 separated VM connecting to a load balancer 1
Group B
2 VMs connecting to a load balancer 1
2 VMs connecting to a load balancer 2
1 separated VM connecting to a load balancer 1
Group A and B are the same, and they can talk to each other via load balancer.
My idea:
I am thinking of using modules (VM modules, load balancer modules,… ) and arrange them in 1 Terraform template which will provision everything in the environment as mentioned above.
And then I will use Chef to configure them later after the provision.
Questions:
Is the above approach the best way to achieve the goal of creating a complete environment via Terraform?
Will I encounter any difficulties or problems later with this approach?