github.com/shvar/terraform@v0.6.9-0.20151215234924-3365cd2231df/website/source/docs/providers/azurerm/r/virtual_network.html.markdown (about) 1 --- 2 layout: "azurerm" 3 page_title: "Azure Resource Manager: azure_virtual_network" 4 sidebar_current: "docs-azurerm-resource-virtual-network" 5 description: |- 6 Creates a new virtual network including any configured subnets. Each subnet can optionally be configured with a security group to be associated with the subnet. 7 --- 8 9 # azurerm\_virtual\_network 10 11 Creates a new virtual network including any configured subnets. Each subnet can 12 optionally be configured with a security group to be associated with the subnet. 13 14 ## Example Usage 15 16 ``` 17 resource "azurerm_virtual_network" "test" { 18 name = "virtualNetwork1" 19 resource_group_name = "${azurerm_resource_group.test.name}" 20 address_space = ["10.0.0.0/16"] 21 location = "West US" 22 23 subnet { 24 name = "subnet1" 25 address_prefix = "10.0.1.0/24" 26 } 27 28 subnet { 29 name = "subnet2" 30 address_prefix = "10.0.2.0/24" 31 } 32 33 subnet { 34 name = "subnet3" 35 address_prefix = "10.0.3.0/24" 36 } 37 } 38 ``` 39 40 ## Argument Reference 41 42 The following arguments are supported: 43 44 * `name` - (Required) The name of the virtual network. Changing this forces a 45 new resource to be created. 46 47 * `resource_group_name` - (Required) The name of the resource group in which to 48 create the virtual network. 49 50 * `address_space` - (Required) The address space that is used the virtual 51 network. You can supply more than one address space. Changing this forces 52 a new resource to be created. 53 54 * `location` - (Required) The location/region where the virtual network is 55 created. Changing this forces a new resource to be created. 56 57 * `dns_servers` - (Optional) List of names of DNS servers previously registered 58 on Azure. 59 60 * `subnet` - (Required) Can be specified multiple times to define multiple 61 subnets. Each `subnet` block supports fields documented below. 62 63 The `subnet` block supports: 64 65 * `name` - (Required) The name of the subnet. 66 67 * `address_prefix` - (Required) The address prefix to use for the subnet. 68 69 * `security_group` - (Optional) The Network Security Group to associate with 70 the subnet. 71 72 ## Attributes Reference 73 74 The following attributes are exported: 75 76 * `id` - The virtual NetworkConfiguration ID.