OpenStack v5.3.3 published on Friday, Sep 12, 2025 by Pulumi
openstack.networking.getNetwork
Use this data source to get the ID of an available OpenStack network.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const network = openstack.networking.getNetwork({
    name: "tf_test_network",
});
import pulumi
import pulumi_openstack as openstack
network = openstack.networking.get_network(name="tf_test_network")
package main
import (
	"github.com/pulumi/pulumi-openstack/sdk/v5/go/openstack/networking"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := networking.LookupNetwork(ctx, &networking.LookupNetworkArgs{
			Name: pulumi.StringRef("tf_test_network"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using OpenStack = Pulumi.OpenStack;
return await Deployment.RunAsync(() => 
{
    var network = OpenStack.Networking.GetNetwork.Invoke(new()
    {
        Name = "tf_test_network",
    });
});
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.GetNetworkArgs;
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 network = NetworkingFunctions.getNetwork(GetNetworkArgs.builder()
            .name("tf_test_network")
            .build());
    }
}
variables:
  network:
    fn::invoke:
      function: openstack:networking:getNetwork
      arguments:
        name: tf_test_network
Using getNetwork
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 getNetwork(args: GetNetworkArgs, opts?: InvokeOptions): Promise<GetNetworkResult>
function getNetworkOutput(args: GetNetworkOutputArgs, opts?: InvokeOptions): Output<GetNetworkResult>def get_network(description: Optional[str] = None,
                external: Optional[bool] = None,
                matching_subnet_cidr: Optional[str] = None,
                mtu: Optional[int] = None,
                name: Optional[str] = None,
                network_id: Optional[str] = None,
                region: Optional[str] = None,
                status: Optional[str] = None,
                tags: Optional[Sequence[str]] = None,
                tenant_id: Optional[str] = None,
                transparent_vlan: Optional[bool] = None,
                opts: Optional[InvokeOptions] = None) -> GetNetworkResult
def get_network_output(description: Optional[pulumi.Input[str]] = None,
                external: Optional[pulumi.Input[bool]] = None,
                matching_subnet_cidr: Optional[pulumi.Input[str]] = None,
                mtu: Optional[pulumi.Input[int]] = None,
                name: Optional[pulumi.Input[str]] = None,
                network_id: Optional[pulumi.Input[str]] = None,
                region: Optional[pulumi.Input[str]] = None,
                status: Optional[pulumi.Input[str]] = None,
                tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                tenant_id: Optional[pulumi.Input[str]] = None,
                transparent_vlan: Optional[pulumi.Input[bool]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetNetworkResult]func LookupNetwork(ctx *Context, args *LookupNetworkArgs, opts ...InvokeOption) (*LookupNetworkResult, error)
func LookupNetworkOutput(ctx *Context, args *LookupNetworkOutputArgs, opts ...InvokeOption) LookupNetworkResultOutput> Note: This function is named LookupNetwork in the Go SDK.
public static class GetNetwork 
{
    public static Task<GetNetworkResult> InvokeAsync(GetNetworkArgs args, InvokeOptions? opts = null)
    public static Output<GetNetworkResult> Invoke(GetNetworkInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetNetworkResult> getNetwork(GetNetworkArgs args, InvokeOptions options)
public static Output<GetNetworkResult> getNetwork(GetNetworkArgs args, InvokeOptions options)
fn::invoke:
  function: openstack:networking/getNetwork:getNetwork
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Description string
- Human-readable description of the network.
- External bool
- The external routing facility of the network.
- MatchingSubnet stringCidr 
- The CIDR of a subnet within the network.
- Mtu int
- The network MTU to filter. Available, when Neutron net-mtuextension is enabled.
- Name string
- The name of the network.
- NetworkId string
- The ID of the network.
- Region string
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve networks ids. If omitted, the
regionargument of the provider is used.
- Status string
- The status of the network.
- List<string>
- The list of network tags to filter.
- TenantId string
- The owner of the network.
- TransparentVlan bool
- The VLAN transparent attribute for the network.
- Description string
- Human-readable description of the network.
- External bool
- The external routing facility of the network.
- MatchingSubnet stringCidr 
- The CIDR of a subnet within the network.
- Mtu int
- The network MTU to filter. Available, when Neutron net-mtuextension is enabled.
- Name string
- The name of the network.
- NetworkId string
- The ID of the network.
- Region string
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve networks ids. If omitted, the
regionargument of the provider is used.
- Status string
- The status of the network.
- []string
- The list of network tags to filter.
- TenantId string
- The owner of the network.
- TransparentVlan bool
- The VLAN transparent attribute for the network.
- description String
- Human-readable description of the network.
- external Boolean
- The external routing facility of the network.
- matchingSubnet StringCidr 
- The CIDR of a subnet within the network.
- mtu Integer
- The network MTU to filter. Available, when Neutron net-mtuextension is enabled.
- name String
- The name of the network.
- networkId String
- The ID of the network.
- region String
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve networks ids. If omitted, the
regionargument of the provider is used.
- status String
- The status of the network.
- List<String>
- The list of network tags to filter.
- tenantId String
- The owner of the network.
- transparentVlan Boolean
- The VLAN transparent attribute for the network.
- description string
- Human-readable description of the network.
- external boolean
- The external routing facility of the network.
- matchingSubnet stringCidr 
- The CIDR of a subnet within the network.
- mtu number
- The network MTU to filter. Available, when Neutron net-mtuextension is enabled.
- name string
- The name of the network.
- networkId string
- The ID of the network.
- region string
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve networks ids. If omitted, the
regionargument of the provider is used.
- status string
- The status of the network.
- string[]
- The list of network tags to filter.
- tenantId string
- The owner of the network.
- transparentVlan boolean
- The VLAN transparent attribute for the network.
- description str
- Human-readable description of the network.
- external bool
- The external routing facility of the network.
- matching_subnet_ strcidr 
- The CIDR of a subnet within the network.
- mtu int
- The network MTU to filter. Available, when Neutron net-mtuextension is enabled.
- name str
- The name of the network.
- network_id str
- The ID of the network.
- region str
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve networks ids. If omitted, the
regionargument of the provider is used.
- status str
- The status of the network.
- Sequence[str]
- The list of network tags to filter.
- tenant_id str
- The owner of the network.
- transparent_vlan bool
- The VLAN transparent attribute for the network.
- description String
- Human-readable description of the network.
- external Boolean
- The external routing facility of the network.
- matchingSubnet StringCidr 
- The CIDR of a subnet within the network.
- mtu Number
- The network MTU to filter. Available, when Neutron net-mtuextension is enabled.
- name String
- The name of the network.
- networkId String
- The ID of the network.
- region String
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve networks ids. If omitted, the
regionargument of the provider is used.
- status String
- The status of the network.
- List<String>
- The list of network tags to filter.
- tenantId String
- The owner of the network.
- transparentVlan Boolean
- The VLAN transparent attribute for the network.
getNetwork Result
The following output properties are available:
- AdminState stringUp 
- The administrative state of the network.
- List<string>
- The set of string tags applied on the network.
- AvailabilityZone List<string>Hints 
- The availability zone candidates for the network.
- DnsDomain string
- The network DNS domain. Available, when Neutron DNS extension is enabled
- Id string
- The provider-assigned unique ID for this managed resource.
- Region string
- See Argument Reference above.
- Segments
List<Pulumi.Open Stack. Networking. Outputs. Get Network Segment> 
- An array of one or more provider segment objects.
- string
- Specifies whether the network resource can be accessed by any tenant or not.
- Subnets List<string>
- A list of subnet IDs belonging to the network.
- Description string
- See Argument Reference above.
- External bool
- See Argument Reference above.
- MatchingSubnet stringCidr 
- Mtu int
- See Argument Reference above.
- Name string
- See Argument Reference above.
- NetworkId string
- Status string
- List<string>
- TenantId string
- TransparentVlan bool
- See Argument Reference above.
- AdminState stringUp 
- The administrative state of the network.
- []string
- The set of string tags applied on the network.
- AvailabilityZone []stringHints 
- The availability zone candidates for the network.
- DnsDomain string
- The network DNS domain. Available, when Neutron DNS extension is enabled
- Id string
- The provider-assigned unique ID for this managed resource.
- Region string
- See Argument Reference above.
- Segments
[]GetNetwork Segment 
- An array of one or more provider segment objects.
- string
- Specifies whether the network resource can be accessed by any tenant or not.
- Subnets []string
- A list of subnet IDs belonging to the network.
- Description string
- See Argument Reference above.
- External bool
- See Argument Reference above.
- MatchingSubnet stringCidr 
- Mtu int
- See Argument Reference above.
- Name string
- See Argument Reference above.
- NetworkId string
- Status string
- []string
- TenantId string
- TransparentVlan bool
- See Argument Reference above.
- adminState StringUp 
- The administrative state of the network.
- List<String>
- The set of string tags applied on the network.
- availabilityZone List<String>Hints 
- The availability zone candidates for the network.
- dnsDomain String
- The network DNS domain. Available, when Neutron DNS extension is enabled
- id String
- The provider-assigned unique ID for this managed resource.
- region String
- See Argument Reference above.
- segments
List<GetNetwork Segment> 
- An array of one or more provider segment objects.
- String
- Specifies whether the network resource can be accessed by any tenant or not.
- subnets List<String>
- A list of subnet IDs belonging to the network.
- description String
- See Argument Reference above.
- external Boolean
- See Argument Reference above.
- matchingSubnet StringCidr 
- mtu Integer
- See Argument Reference above.
- name String
- See Argument Reference above.
- networkId String
- status String
- List<String>
- tenantId String
- transparentVlan Boolean
- See Argument Reference above.
- adminState stringUp 
- The administrative state of the network.
- string[]
- The set of string tags applied on the network.
- availabilityZone string[]Hints 
- The availability zone candidates for the network.
- dnsDomain string
- The network DNS domain. Available, when Neutron DNS extension is enabled
- id string
- The provider-assigned unique ID for this managed resource.
- region string
- See Argument Reference above.
- segments
GetNetwork Segment[] 
- An array of one or more provider segment objects.
- string
- Specifies whether the network resource can be accessed by any tenant or not.
- subnets string[]
- A list of subnet IDs belonging to the network.
- description string
- See Argument Reference above.
- external boolean
- See Argument Reference above.
- matchingSubnet stringCidr 
- mtu number
- See Argument Reference above.
- name string
- See Argument Reference above.
- networkId string
- status string
- string[]
- tenantId string
- transparentVlan boolean
- See Argument Reference above.
- admin_state_ strup 
- The administrative state of the network.
- Sequence[str]
- The set of string tags applied on the network.
- availability_zone_ Sequence[str]hints 
- The availability zone candidates for the network.
- dns_domain str
- The network DNS domain. Available, when Neutron DNS extension is enabled
- id str
- The provider-assigned unique ID for this managed resource.
- region str
- See Argument Reference above.
- segments
Sequence[GetNetwork Segment] 
- An array of one or more provider segment objects.
- str
- Specifies whether the network resource can be accessed by any tenant or not.
- subnets Sequence[str]
- A list of subnet IDs belonging to the network.
- description str
- See Argument Reference above.
- external bool
- See Argument Reference above.
- matching_subnet_ strcidr 
- mtu int
- See Argument Reference above.
- name str
- See Argument Reference above.
- network_id str
- status str
- Sequence[str]
- tenant_id str
- transparent_vlan bool
- See Argument Reference above.
- adminState StringUp 
- The administrative state of the network.
- List<String>
- The set of string tags applied on the network.
- availabilityZone List<String>Hints 
- The availability zone candidates for the network.
- dnsDomain String
- The network DNS domain. Available, when Neutron DNS extension is enabled
- id String
- The provider-assigned unique ID for this managed resource.
- region String
- See Argument Reference above.
- segments List<Property Map>
- An array of one or more provider segment objects.
- String
- Specifies whether the network resource can be accessed by any tenant or not.
- subnets List<String>
- A list of subnet IDs belonging to the network.
- description String
- See Argument Reference above.
- external Boolean
- See Argument Reference above.
- matchingSubnet StringCidr 
- mtu Number
- See Argument Reference above.
- name String
- See Argument Reference above.
- networkId String
- status String
- List<String>
- tenantId String
- transparentVlan Boolean
- See Argument Reference above.
Supporting Types
GetNetworkSegment  
- NetworkType string
- PhysicalNetwork string
- SegmentationId int
- NetworkType string
- PhysicalNetwork string
- SegmentationId int
- networkType String
- physicalNetwork String
- segmentationId Integer
- networkType string
- physicalNetwork string
- segmentationId number
- network_type str
- physical_network str
- segmentation_id int
- networkType String
- physicalNetwork String
- segmentationId Number
Package Details
- Repository
- OpenStack pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the openstackTerraform Provider.
