Terraform Ways of Working
- Ensure you know how to manually create resources
- List out all the resources and ensure you have creation order
- For each resource, list all the inputs you are passing
- For each resource you have created manually, find the equivelent terraform resource.
Activity 1: Create a vpc and 4 subnets in AWS
- Manual steps: For guided creation on console refer class room video.
- Refer Here for changes done
Resource Block
- In terraform, the language which we use is called as HCL (Hashicorp configuration language) Refer Here
- Resource syntax
resource "type_of_resource" "name" {
arg1 = value1
arg2 = value2
...
argn = valuen
}
- Values can be of different types Refer Here
- Basic:
- string
- number
- bool
- To use attributes the syntax is
<resource-type>.<name>.<attribute>
Activity 2: Create a virtual network in Azure
- Refer Here for virtual network quick start
- Manual steps: For guided creation on console refer class room video.
- We have done till resource group creation and to be continued in the next session
- Refer Here for the changes done so far.
