From the course: Introduction to Terraform on Azure

Unlock the full course today

Join today to access over 23,400 courses taught by industry experts.

Creating a subnet

Creating a subnet

- [Instructor] For this module, we'll be learning on how to create a subnet resource block in Terraform. Since we've just created our azurerm_virtual_network resource block, we're now going to create our subnet. So there are actually two different ways to create a subnet within our azurerm provider. We can create the subnet in the virtual network resource block or we can create its completely own resource block. For the purposes of this demo, I am going to be creating its own resource block and keeping with the naming convention, I am going to reference this as main locally since this will be the main subnet that we'll be using throughout this configuration file. Again, really similarly on how we've been referencing our previous modules, we're going to do the same within the azurerm_subnet resource block. So first, let's create a name. So I'm going to keep this naming convention that we've been doing throughout.…

Contents