What would be the best practice for implementing Terraform?
My case: Ideally, I want to use build a CI/CD pipeline in Azure DevOps that will use Terraform to provision infrastructure resources in Azure, then configure them by using Chef (ChefSolo atm, will just Chef Server later in a long run)
I have created a working pipeline that helps me provision a basic Azure VM. However, the structure of Terraform is very basic and not using any Terraform variables files. All the variables are stored as pipeline variables which will be replaced by tokens in Terraform files during the build/release process.
In a long run, we want to use Terraform to create resources for different environments: devlopment, QA, production. And for each environment, there are some certain machine types with different specifications. How would I then structure all my Terraform files in the most effective ways as well as how to manage all the variables files for those machine types terraform file.
And if I want to integrate Chef to the Terraform CI/CD pipeline, how would I achieve that? I know that there is a provisioner step in Terraform that we could use to install and connect the resource to Chef server? But is that a good way though, and what if I only use ChefSolo, how would I integrate ChefSolo into this Terraform pipeline?
Thanks so much.