» opentelekomcloud_networking_subnet_v2

Manages a V2 Neutron subnet resource within OpenTelekomCloud.

» Example Usage

resource "opentelekomcloud_networking_network_v2" "network_1" {
  name           = "tf_test_network"
  admin_state_up = "true"
}

resource "opentelekomcloud_networking_subnet_v2" "subnet_1" {
  network_id = "${opentelekomcloud_networking_network_v2.network_1.id}"
  cidr       = "192.168.199.0/24"
}

» Argument Reference

The following arguments are supported:

  • network_id - (Required) The UUID of the parent network. Changing this creates a new subnet.

  • cidr - (Required) CIDR representing IP range for this subnet, based on IP version. Changing this creates a new subnet.

  • ip_version - (Optional) IP version, either 4 (default) or 6. Changing this creates a new subnet.

  • name - (Optional) The name of the subnet. Changing this updates the name of the existing subnet.

  • tenant_id - (Optional) The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.

  • allocation_pools - (Optional) An array of sub-ranges of CIDR available for dynamic allocation to ports. The allocation_pool object structure is documented below. Changing this creates a new subnet.

  • gateway_ip - (Optional) Default gateway used by devices in this subnet. Leaving this blank and not setting no_gateway will cause a default gateway of .1 to be used. Changing this updates the gateway IP of the existing subnet.

  • no_gateway - (Optional) Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.

  • enable_dhcp - (Optional) The administrative state of the network. Acceptable values are "true" and "false". Changing this value enables or disables the DHCP capabilities of the existing subnet. Defaults to true.

  • dns_nameservers - (Optional) An array of DNS name server names used by hosts in this subnet. Changing this updates the DNS name servers for the existing subnet.

  • host_routes - (Optional) An array of routes that should be used by devices with IPs from this subnet (not including local subnet route). The host_route object structure is documented below. Changing this updates the host routes for the existing subnet.

  • value_specs - (Optional) Map of additional options.

The allocation_pools block supports:

  • start - (Required) The starting address.

  • end - (Required) The ending address.

The host_routes block supports:

» Attributes Reference

The following attributes are exported:

» Import

Subnets can be imported using the id, e.g.

$ terraform import opentelekomcloud_networking_subnet_v2.subnet_1 da4faf16-5546-41e4-8330-4d0002b74048