github.com/brandonstevens/terraform@v0.9.6-0.20170512224929-5367f2607e16/examples/azure-vnet-two-subnets/main.tf (about) 1 # provider "azurerm" { 2 # subscription_id = "REPLACE-WITH-YOUR-SUBSCRIPTION-ID" 3 # client_id = "REPLACE-WITH-YOUR-CLIENT-ID" 4 # client_secret = "REPLACE-WITH-YOUR-CLIENT-SECRET" 5 # tenant_id = "REPLACE-WITH-YOUR-TENANT-ID" 6 # } 7 8 resource "azurerm_resource_group" "rg" { 9 name = "${var.resource_group}" 10 location = "${var.location}" 11 } 12 13 resource "azurerm_virtual_network" "vnet" { 14 name = "${var.resource_group}vnet" 15 location = "${var.location}" 16 address_space = ["10.0.0.0/16"] 17 resource_group_name = "${azurerm_resource_group.rg.name}" 18 } 19 20 resource "azurerm_subnet" "subnet1" { 21 name = "subnet1" 22 virtual_network_name = "${azurerm_virtual_network.vnet.name}" 23 resource_group_name = "${azurerm_resource_group.rg.name}" 24 address_prefix = "10.0.0.0/24" 25 } 26 27 resource "azurerm_subnet" "subnet2" { 28 name = "subnet2" 29 virtual_network_name = "${azurerm_virtual_network.vnet.name}" 30 resource_group_name = "${azurerm_resource_group.rg.name}" 31 address_prefix = "10.0.1.0/24" 32 }