github.com/hobbeswalsh/terraform@v0.3.7-0.20150619183303-ad17cf55a0fa/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 ip_version = 4 25 } 26 ``` 27 28 ## Argument Reference 29 30 The following arguments are supported: 31 32 * `region` - (Required) The region in which to obtain the V2 Networking client. 33 A Networking client is needed to create a Neutron subnet. If omitted, the 34 `OS_REGION_NAME` environment variable is used. Changing this creates a new 35 subnet. 36 37 * `network_id` - (Required) The UUID of the parent network. Changing this 38 creates a new subnet. 39 40 * `cidr` - (Required) CIDR representing IP range for this subnet, based on IP 41 version. Changing this creates a new subnet. 42 43 * `ip_version` - (Required) IP version, either 4 or 6. Changing this creates a 44 new subnet. 45 46 * `name` - (Optional) The name of the subnet. Changing this updates the name of 47 the existing subnet. 48 49 * `tenant_id` - (Optional) The owner of the subnet. Required if admin wants to 50 create a subnet for another tenant. Changing this creates a new subnet. 51 52 * `allocation_pools` - (Optional) An array of sub-ranges of CIDR available for 53 dynamic allocation to ports. The allocation_pool object structure is 54 documented below. Changing this creates a new subnet. 55 56 * `gateway_ip` - (Optional) Default gateway used by devices in this subnet. 57 Changing this updates the gateway IP of the existing subnet. 58 59 * `enable_dhcp` - (Optional) The administrative state of the network. 60 Acceptable values are "true" and "false". Changing this value enables or 61 disables the DHCP capabilities of the existing subnet. 62 63 * `dns_nameservers` - (Optional) An array of DNS name server names used by hosts 64 in this subnet. Changing this updates the DNS name servers for the existing 65 subnet. 66 67 * `host_routes` - (Optional) An array of routes that should be used by devices 68 with IPs from this subnet (not including local subnet route). The host_route 69 object structure is documented below. Changing this updates the host routes 70 for the existing subnet. 71 72 The `allocation_pools` block supports: 73 74 * `start` - (Required) The starting address. 75 76 * `end` - (Required) The ending address. 77 78 The `host_routes` block supports: 79 80 * `destination_cidr` - (Required) The destination CIDR. 81 82 * `next_hop` - (Required) The next hop in the route. 83 84 ## Attributes Reference 85 86 The following attributes are exported: 87 88 * `region` - See Argument Reference above. 89 * `network_id` - See Argument Reference above. 90 * `cidr` - See Argument Reference above. 91 * `ip_version` - See Argument Reference above. 92 * `name` - See Argument Reference above. 93 * `tenant_id` - See Argument Reference above. 94 * `allocation_pools` - See Argument Reference above. 95 * `gateway_ip` - See Argument Reference above. 96 * `enable_dhcp` - See Argument Reference above. 97 * `dns_nameservers` - See Argument Reference above. 98 * `host_routes` - See Argument Reference above.