github.com/erriapo/terraform@v0.6.12-0.20160203182612-0340ea72354f/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  
    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    tags {
    39      environment = "Production"
    40    }
    41  }
    42  ```
    43  
    44  ## Argument Reference
    45  
    46  The following arguments are supported:
    47  
    48  * `name` - (Required) The name of the virtual network. Changing this forces a
    49      new resource to be created.
    50  
    51  * `resource_group_name` - (Required) The name of the resource group in which to
    52      create the virtual network.
    53  
    54  * `address_space` - (Required) The address space that is used the virtual
    55      network. You can supply more than one address space. Changing this forces
    56      a new resource to be created.
    57  
    58  * `location` - (Required) The location/region where the virtual network is
    59      created. Changing this forces a new resource to be created.
    60  
    61  * `dns_servers` - (Optional) List of names of DNS servers previously registered
    62      on Azure.
    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.