From the course: Introduction to Terraform on Azure

Unlock this course with a free trial

Join today to access over 25,600 courses taught by industry experts.

Reference and deploy compute module

Reference and deploy compute module

- [Instructor] I hope you were able to follow along with defining the compute model in the previous videos. It's time to update our root model. So in my Explorer view, I'll select the main.tf and then scroll down and let's highlight everything after the provider block. So from the locals, all the way down, and delete these entries. Now we need to create a model block. So create a new line and type model and the name of this model will be compute. Enter the new line, and in here, we'll define the source of the model. So ./models/compute. Now let's create a new line and we need to define all the variables that is needed by this model. For the project name, I'll use projkpi. You can use any name you would like. The model also needs a team_name variable, so we would use var.team_name. We also need to define environment, var.environment, and it's a defined location, which is var.location. Address_space = var.address_space. Subnet_prefixes. Var.subnet_prefixes. Then the vm_count…

Contents