openstack_networking_subnet_ids_v2
This instruction is an adapted copy of the official OpenStack Terraform provider documentation in the Terraform Registry.
Use this data source to get a list of OpenStack Subnet IDs that match the specified criteria.
Example Usage
data "openstack_networking_subnet_ids_v2" "subnets" {
name_regex = "external"
tags = [
"public"
]
}
Argument Reference
-
region- (Optional) The region from which to obtain the V2 Neutron client. A Neutron client is required to retrieve subnet IDs. If omitted, theregionargument of the provider is used. -
name- (Optional) The name of the subnet. -
description- (Optional) Human-readable description of the subnet. -
dhcp_enabled- (Optional) Whether DHCP is enabled for the subnet. -
network_id- (Optional) The ID of the network the subnet belongs to. -
tenant_id- (Optional) The owner of the subnet. -
ip_version- (Optional) The IP version of the subnet (either 4 or 6). -
gateway_ip- (Optional) The IP address of the subnet gateway. -
cidr- (Optional) The CIDR of the subnet. -
ipv6_address_mode- (Optional) The IPv6 address mode. Valid values aredhcpv6-stateful,dhcpv6-stateless, orslaac. -
ipv6_ra_mode- (Optional) The IPv6 Router Advertisement mode. Valid values aredhcpv6-stateful,dhcpv6-stateless, orslaac. -
subnetpool_id- (Optional) The ID of the subnet pool associated with the subnet. -
tags- (Optional) A list of subnet tags to filter by. -
sort_key- (Optional) Sort subnets based on a specific key. Defaults to none. -
sort_direction- (Optional) Order the results in eitherascordesc. Defaults to none.
Attributes Reference
ids is set to the list of OpenStack Subnet IDs.