openstack.networking.getSubnetIdsV2

Use this data source to get a list of Openstack Subnet IDs matching the specified criteria.

Example Usage

using System.Collections.Generic;
using Pulumi;
using OpenStack = Pulumi.OpenStack;

return await Deployment.RunAsync(() => 
{
    var subnets = OpenStack.Networking.GetSubnetIdsV2.Invoke(new()
    {
        NameRegex = "public",
        Tags = new[]
        {
            "public",
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/networking"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := networking.GetSubnetIdsV2(ctx, &networking.GetSubnetIdsV2Args{
			NameRegex: pulumi.StringRef("public"),
			Tags: []string{
				"public",
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.openstack.networking.NetworkingFunctions;
import com.pulumi.openstack.networking.inputs.GetSubnetIdsV2Args;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var subnets = NetworkingFunctions.getSubnetIdsV2(GetSubnetIdsV2Args.builder()
            .nameRegex("public")
            .tags("public")
            .build());

    }
}
import pulumi
import pulumi_openstack as openstack

subnets = openstack.networking.get_subnet_ids_v2(name_regex="public",
    tags=["public"])
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";

const subnets = openstack.networking.getSubnetIdsV2({
    nameRegex: "public",
    tags: ["public"],
});
variables:
  subnets:
    fn::invoke:
      Function: openstack:networking:getSubnetIdsV2
      Arguments:
        nameRegex: public
        tags:
          - public

Using getSubnetIdsV2

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getSubnetIdsV2(args: GetSubnetIdsV2Args, opts?: InvokeOptions): Promise<GetSubnetIdsV2Result>
function getSubnetIdsV2Output(args: GetSubnetIdsV2OutputArgs, opts?: InvokeOptions): Output<GetSubnetIdsV2Result>
def get_subnet_ids_v2(cidr: Optional[str] = None,
                      description: Optional[str] = None,
                      dhcp_enabled: Optional[bool] = None,
                      gateway_ip: Optional[str] = None,
                      ip_version: Optional[int] = None,
                      ipv6_address_mode: Optional[str] = None,
                      ipv6_ra_mode: Optional[str] = None,
                      name: Optional[str] = None,
                      name_regex: Optional[str] = None,
                      network_id: Optional[str] = None,
                      region: Optional[str] = None,
                      sort_direction: Optional[str] = None,
                      sort_key: Optional[str] = None,
                      subnetpool_id: Optional[str] = None,
                      tags: Optional[Sequence[str]] = None,
                      tenant_id: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetSubnetIdsV2Result
def get_subnet_ids_v2_output(cidr: Optional[pulumi.Input[str]] = None,
                      description: Optional[pulumi.Input[str]] = None,
                      dhcp_enabled: Optional[pulumi.Input[bool]] = None,
                      gateway_ip: Optional[pulumi.Input[str]] = None,
                      ip_version: Optional[pulumi.Input[int]] = None,
                      ipv6_address_mode: Optional[pulumi.Input[str]] = None,
                      ipv6_ra_mode: Optional[pulumi.Input[str]] = None,
                      name: Optional[pulumi.Input[str]] = None,
                      name_regex: Optional[pulumi.Input[str]] = None,
                      network_id: Optional[pulumi.Input[str]] = None,
                      region: Optional[pulumi.Input[str]] = None,
                      sort_direction: Optional[pulumi.Input[str]] = None,
                      sort_key: Optional[pulumi.Input[str]] = None,
                      subnetpool_id: Optional[pulumi.Input[str]] = None,
                      tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                      tenant_id: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetSubnetIdsV2Result]
func GetSubnetIdsV2(ctx *Context, args *GetSubnetIdsV2Args, opts ...InvokeOption) (*GetSubnetIdsV2Result, error)
func GetSubnetIdsV2Output(ctx *Context, args *GetSubnetIdsV2OutputArgs, opts ...InvokeOption) GetSubnetIdsV2ResultOutput

> Note: This function is named GetSubnetIdsV2 in the Go SDK.

public static class GetSubnetIdsV2 
{
    public static Task<GetSubnetIdsV2Result> InvokeAsync(GetSubnetIdsV2Args args, InvokeOptions? opts = null)
    public static Output<GetSubnetIdsV2Result> Invoke(GetSubnetIdsV2InvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSubnetIdsV2Result> getSubnetIdsV2(GetSubnetIdsV2Args args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: openstack:networking/getSubnetIdsV2:getSubnetIdsV2
  arguments:
    # arguments dictionary

The following arguments are supported:

Cidr string

The CIDR of the subnet.

Description string

Human-readable description of the subnet.

DhcpEnabled bool

If the subnet has DHCP enabled.

GatewayIp string

The IP of the subnet's gateway.

IpVersion int

The IP version of the subnet (either 4 or 6).

Ipv6AddressMode string

The IPv6 address mode. Valid values are dhcpv6-stateful, dhcpv6-stateless, or slaac.

Ipv6RaMode string

The IPv6 Router Advertisement mode. Valid values are dhcpv6-stateful, dhcpv6-stateless, or slaac.

Name string

The name of the subnet.

NameRegex string
NetworkId string

The ID of the network the subnet belongs to.

Region string

The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve subnet ids. If omitted, the region argument of the provider is used.

SortDirection string

Order the results in either asc or desc. Defaults to none.

SortKey string

Sort subnets based on a certain key. Defaults to none.

SubnetpoolId string

The ID of the subnetpool associated with the subnet.

Tags List<string>

The list of subnet tags to filter.

TenantId string

The owner of the subnet.

Cidr string

The CIDR of the subnet.

Description string

Human-readable description of the subnet.

DhcpEnabled bool

If the subnet has DHCP enabled.

GatewayIp string

The IP of the subnet's gateway.

IpVersion int

The IP version of the subnet (either 4 or 6).

Ipv6AddressMode string

The IPv6 address mode. Valid values are dhcpv6-stateful, dhcpv6-stateless, or slaac.

Ipv6RaMode string

The IPv6 Router Advertisement mode. Valid values are dhcpv6-stateful, dhcpv6-stateless, or slaac.

Name string

The name of the subnet.

NameRegex string
NetworkId string

The ID of the network the subnet belongs to.

Region string

The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve subnet ids. If omitted, the region argument of the provider is used.

SortDirection string

Order the results in either asc or desc. Defaults to none.

SortKey string

Sort subnets based on a certain key. Defaults to none.

SubnetpoolId string

The ID of the subnetpool associated with the subnet.

Tags []string

The list of subnet tags to filter.

TenantId string

The owner of the subnet.

cidr String

The CIDR of the subnet.

description String

Human-readable description of the subnet.

dhcpEnabled Boolean

If the subnet has DHCP enabled.

gatewayIp String

The IP of the subnet's gateway.

ipVersion Integer

The IP version of the subnet (either 4 or 6).

ipv6AddressMode String

The IPv6 address mode. Valid values are dhcpv6-stateful, dhcpv6-stateless, or slaac.

ipv6RaMode String

The IPv6 Router Advertisement mode. Valid values are dhcpv6-stateful, dhcpv6-stateless, or slaac.

name String

The name of the subnet.

nameRegex String
networkId String

The ID of the network the subnet belongs to.

region String

The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve subnet ids. If omitted, the region argument of the provider is used.

sortDirection String

Order the results in either asc or desc. Defaults to none.

sortKey String

Sort subnets based on a certain key. Defaults to none.

subnetpoolId String

The ID of the subnetpool associated with the subnet.

tags List<String>

The list of subnet tags to filter.

tenantId String

The owner of the subnet.

cidr string

The CIDR of the subnet.

description string

Human-readable description of the subnet.

dhcpEnabled boolean

If the subnet has DHCP enabled.

gatewayIp string

The IP of the subnet's gateway.

ipVersion number

The IP version of the subnet (either 4 or 6).

ipv6AddressMode string

The IPv6 address mode. Valid values are dhcpv6-stateful, dhcpv6-stateless, or slaac.

ipv6RaMode string

The IPv6 Router Advertisement mode. Valid values are dhcpv6-stateful, dhcpv6-stateless, or slaac.

name string

The name of the subnet.

nameRegex string
networkId string

The ID of the network the subnet belongs to.

region string

The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve subnet ids. If omitted, the region argument of the provider is used.

sortDirection string

Order the results in either asc or desc. Defaults to none.

sortKey string

Sort subnets based on a certain key. Defaults to none.

subnetpoolId string

The ID of the subnetpool associated with the subnet.

tags string[]

The list of subnet tags to filter.

tenantId string

The owner of the subnet.

cidr str

The CIDR of the subnet.

description str

Human-readable description of the subnet.

dhcp_enabled bool

If the subnet has DHCP enabled.

gateway_ip str

The IP of the subnet's gateway.

ip_version int

The IP version of the subnet (either 4 or 6).

ipv6_address_mode str

The IPv6 address mode. Valid values are dhcpv6-stateful, dhcpv6-stateless, or slaac.

ipv6_ra_mode str

The IPv6 Router Advertisement mode. Valid values are dhcpv6-stateful, dhcpv6-stateless, or slaac.

name str

The name of the subnet.

name_regex str
network_id str

The ID of the network the subnet belongs to.

region str

The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve subnet ids. If omitted, the region argument of the provider is used.

sort_direction str

Order the results in either asc or desc. Defaults to none.

sort_key str

Sort subnets based on a certain key. Defaults to none.

subnetpool_id str

The ID of the subnetpool associated with the subnet.

tags Sequence[str]

The list of subnet tags to filter.

tenant_id str

The owner of the subnet.

cidr String

The CIDR of the subnet.

description String

Human-readable description of the subnet.

dhcpEnabled Boolean

If the subnet has DHCP enabled.

gatewayIp String

The IP of the subnet's gateway.

ipVersion Number

The IP version of the subnet (either 4 or 6).

ipv6AddressMode String

The IPv6 address mode. Valid values are dhcpv6-stateful, dhcpv6-stateless, or slaac.

ipv6RaMode String

The IPv6 Router Advertisement mode. Valid values are dhcpv6-stateful, dhcpv6-stateless, or slaac.

name String

The name of the subnet.

nameRegex String
networkId String

The ID of the network the subnet belongs to.

region String

The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve subnet ids. If omitted, the region argument of the provider is used.

sortDirection String

Order the results in either asc or desc. Defaults to none.

sortKey String

Sort subnets based on a certain key. Defaults to none.

subnetpoolId String

The ID of the subnetpool associated with the subnet.

tags List<String>

The list of subnet tags to filter.

tenantId String

The owner of the subnet.

getSubnetIdsV2 Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
Ipv6RaMode string
Region string
Cidr string
Description string
DhcpEnabled bool
GatewayIp string
IpVersion int
Ipv6AddressMode string
Name string
NameRegex string
NetworkId string
SortDirection string
SortKey string
SubnetpoolId string
Tags List<string>
TenantId string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
Ipv6RaMode string
Region string
Cidr string
Description string
DhcpEnabled bool
GatewayIp string
IpVersion int
Ipv6AddressMode string
Name string
NameRegex string
NetworkId string
SortDirection string
SortKey string
SubnetpoolId string
Tags []string
TenantId string
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
ipv6RaMode String
region String
cidr String
description String
dhcpEnabled Boolean
gatewayIp String
ipVersion Integer
ipv6AddressMode String
name String
nameRegex String
networkId String
sortDirection String
sortKey String
subnetpoolId String
tags List<String>
tenantId String
id string

The provider-assigned unique ID for this managed resource.

ids string[]
ipv6RaMode string
region string
cidr string
description string
dhcpEnabled boolean
gatewayIp string
ipVersion number
ipv6AddressMode string
name string
nameRegex string
networkId string
sortDirection string
sortKey string
subnetpoolId string
tags string[]
tenantId string
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]
ipv6_ra_mode str
region str
cidr str
description str
dhcp_enabled bool
gateway_ip str
ip_version int
ipv6_address_mode str
name str
name_regex str
network_id str
sort_direction str
sort_key str
subnetpool_id str
tags Sequence[str]
tenant_id str
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
ipv6RaMode String
region String
cidr String
description String
dhcpEnabled Boolean
gatewayIp String
ipVersion Number
ipv6AddressMode String
name String
nameRegex String
networkId String
sortDirection String
sortKey String
subnetpoolId String
tags List<String>
tenantId String

Package Details

Repository
OpenStack pulumi/pulumi-openstack
License
Apache-2.0
Notes

This Pulumi package is based on the openstack Terraform Provider.