Terraform contd..
Activity: Create virtual network in Azure
- Manual Steps:
- Create resource group
- Create a VNET with cidr range
192.168.0.0/16
- Create resource group
Writing template for the above in terraform
- Terraform takes the folder as input and reads all the .tf files and while validating,applying or destroying tries to treat all fo the .tf files as one file.
- To Create dependencies we can use depends on meta argument Refer Here
- The resource name in terraform is
<resource_type>.<name>
- Refer Here for the changeset
- Note:
- The commands which we started following
init, fmt, validate, apply
- The commands which we started following
Focus Points
- To Work effectively with terrform templates we need to understand Hashicorp Configuration Language
- How to parametrized the template