github.com/adrian-bl/terraform@v0.7.0-rc2.0.20160705220747-de0a34fc3517/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-network-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    dns_servers         = ["10.0.0.4", "10.0.0.5"]
    23  
    24    subnet {
    25      name           = "subnet1"
    26      address_prefix = "10.0.1.0/24"
    27    }
    28  
    29    subnet {
    30      name           = "subnet2"
    31      address_prefix = "10.0.2.0/24"
    32    }
    33  
    34    subnet {
    35      name           = "subnet3"
    36      address_prefix = "10.0.3.0/24"
    37    }
    38    
    39    tags {
    40      environment = "Production"
    41    }
    42  }
    43  ```
    44  
    45  ## Argument Reference
    46  
    47  The following arguments are supported:
    48  
    49  * `name` - (Required) The name of the virtual network. Changing this forces a
    50      new resource to be created.
    51  
    52  * `resource_group_name` - (Required) The name of the resource group in which to
    53      create the virtual network.
    54  
    55  * `address_space` - (Required) The address space that is used the virtual
    56      network. You can supply more than one address space. Changing this forces
    57      a new resource to be created.
    58  
    59  * `location` - (Required) The location/region where the virtual network is
    60      created. Changing this forces a new resource to be created.
    61  
    62  * `dns_servers` - (Optional) List of IP addresses of DNS servers
    63  
    64  * `subnet` - (Optional) Can be specified multiple times to define multiple
    65      subnets. Each `subnet` block supports fields documented below.
    66  
    67  * `tags` - (Optional) A mapping of tags to assign to the resource. 
    68  
    69  The `subnet` block supports:
    70  
    71  * `name` - (Required) The name of the subnet.
    72  
    73  * `address_prefix` - (Required) The address prefix to use for the subnet.
    74  
    75  * `security_group` - (Optional) The Network Security Group to associate with
    76      the subnet.
    77  
    78  ## Attributes Reference
    79  
    80  The following attributes are exported:
    81  
    82  * `id` - The virtual NetworkConfiguration ID.