Terraform Part 2
In the previous post ' Intro to Terraform ', I provided an introduction to Terraform. In this post, I will be digging a little bit deeper into how Terraform could be used in real world usecases. How to use organize Terraform files? We can organize Terraform files so that, each component which we would provision would go into its own .tf file. That way, we can have a modularized approach. provider.tf This file would have the provider configuration details, so that any change to provider related config could be done in one place. vars.tf This file would have the variables used by every different file. We can variabilize different parts of our infrastructure configuration, like for eg, the CIDR ranges which will be used in VPC and subnet. This way, we can parameterize our provisioning code. One tf file per Component: We can have one .tf file per component, for instance, a vpc.tf file, a subnet.tf file etc. This way we can isolate changes. Data Selecto...