github.com/minamijoyo/terraform@v0.7.8-0.20161029001309-18b3736ba44b/website/source/docs/providers/openstack/r/networking_subnet_v2.html.markdown (about) 1 --- 2 layout: "openstack" 3 page_title: "OpenStack: openstack_networking_subnet_v2" 4 sidebar_current: "docs-openstack-resource-networking-subnet-v2" 5 description: |- 6 Manages a V2 Neutron subnet resource within OpenStack. 7 --- 8 9 # openstack\_networking\_subnet_v2 10 11 Manages a V2 Neutron subnet resource within OpenStack. 12 13 ## Example Usage 14 15 ``` 16 resource "openstack_networking_network_v2" "network_1" { 17 name = "tf_test_network" 18 admin_state_up = "true" 19 } 20 21 resource "openstack_networking_subnet_v2" "subnet_1" { 22 network_id = "${openstack_networking_network_v2.network_1.id}" 23 cidr = "192.168.199.0/24" 24 } 25 ``` 26 27 ## Argument Reference 28 29 The following arguments are supported: 30 31 * `region` - (Required) The region in which to obtain the V2 Networking client. 32 A Networking client is needed to create a Neutron subnet. If omitted, the 33 `OS_REGION_NAME` environment variable is used. Changing this creates a new 34 subnet. 35 36 * `network_id` - (Required) The UUID of the parent network. Changing this 37 creates a new subnet. 38 39 * `cidr` - (Required) CIDR representing IP range for this subnet, based on IP 40 version. Changing this creates a new subnet. 41 42 * `ip_version` - (Optional) IP version, either 4 (default) or 6. Changing this creates a 43 new subnet. 44 45 * `name` - (Optional) The name of the subnet. Changing this updates the name of 46 the existing subnet. 47 48 * `tenant_id` - (Optional) The owner of the subnet. Required if admin wants to 49 create a subnet for another tenant. Changing this creates a new subnet. 50 51 * `allocation_pools` - (Optional) An array of sub-ranges of CIDR available for 52 dynamic allocation to ports. The allocation_pool object structure is 53 documented below. Changing this creates a new subnet. 54 55 * `gateway_ip` - (Optional) Default gateway used by devices in this subnet. 56 Leaving this blank and not setting `no_gateway` will cause a default 57 gateway of `.1` to be used. Changing this updates the gateway IP of the 58 existing subnet. 59 60 * `no_gateway` - (Optional) Do not set a gateway IP on this subnet. Changing 61 this removes or adds a default gateway IP of the existing subnet. 62 63 * `enable_dhcp` - (Optional) The administrative state of the network. 64 Acceptable values are "true" and "false". Changing this value enables or 65 disables the DHCP capabilities of the existing subnet. Defaults to true. 66 67 * `dns_nameservers` - (Optional) An array of DNS name server names used by hosts 68 in this subnet. Changing this updates the DNS name servers for the existing 69 subnet. 70 71 * `host_routes` - (Optional) An array of routes that should be used by devices 72 with IPs from this subnet (not including local subnet route). The host_route 73 object structure is documented below. Changing this updates the host routes 74 for the existing subnet. 75 76 * `value_specs` - (Optional) Map of additional options. 77 78 The `allocation_pools` block supports: 79 80 * `start` - (Required) The starting address. 81 82 * `end` - (Required) The ending address. 83 84 The `host_routes` block supports: 85 86 * `destination_cidr` - (Required) The destination CIDR. 87 88 * `next_hop` - (Required) The next hop in the route. 89 90 ## Attributes Reference 91 92 The following attributes are exported: 93 94 * `region` - See Argument Reference above. 95 * `network_id` - See Argument Reference above. 96 * `cidr` - See Argument Reference above. 97 * `ip_version` - See Argument Reference above. 98 * `name` - See Argument Reference above. 99 * `tenant_id` - See Argument Reference above. 100 * `allocation_pools` - See Argument Reference above. 101 * `gateway_ip` - See Argument Reference above. 102 * `enable_dhcp` - See Argument Reference above. 103 * `dns_nameservers` - See Argument Reference above. 104 * `host_routes` - See Argument Reference above. 105 106 ## Import 107 108 Subnets can be imported using the `id`, e.g. 109 110 ``` 111 $ terraform import openstack_networking_subnet_v2.subnet_1 da4faf16-5546-41e4-8330-4d0002b74048 112 ```