Terraform order of Creation
- Way of Working of terraform
- Inputs to a resource is argument and output of a resource is attribute
- To use attribute
resource_type.resource_name.<attribute>
- Implicit Dependency: using attributes of one resource as input i.e arguments to other resource will create implicit dependency. Refer Here for the changes with implicit
- Explicit dependencies Refer Here
- Refer Here for the fix done to solve the proble with azure where creation of resources were failing when we executed apply first time.
Exercise
- Refer for manual screenshots of AWS and Azure Below
AWS
- Create a VPC
- Create 6 subnets with name tags subnet1, subnet2, subnet3, subnet4, subnet5, subnet6
Azure
- Create a resource group
- Create a Vnet with 6 subnets