1. Packages
  2. Openstack Provider
  3. API Docs
  4. networking
  5. getNetwork
OpenStack v5.0.3 published on Wednesday, Feb 12, 2025 by Pulumi

openstack.networking.getNetwork

Explore with Pulumi AI

OpenStack v5.0.3 published on Wednesday, Feb 12, 2025 by Pulumi

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",
});
Copy
import pulumi
import pulumi_openstack as openstack

network = openstack.networking.get_network(name="tf_test_network")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  network:
    fn::invoke:
      function: openstack:networking:getNetwork
      arguments:
        name: tf_test_network
Copy

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>
Copy
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]
Copy
func LookupNetwork(ctx *Context, args *LookupNetworkArgs, opts ...InvokeOption) (*LookupNetworkResult, error)
func LookupNetworkOutput(ctx *Context, args *LookupNetworkOutputArgs, opts ...InvokeOption) LookupNetworkResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetNetworkResult> getNetwork(GetNetworkArgs args, InvokeOptions options)
public static Output<GetNetworkResult> getNetwork(GetNetworkArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: openstack:networking/getNetwork:getNetwork
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Description string
Human-readable description of the network.
External bool
The external routing facility of the network.
MatchingSubnetCidr string
The CIDR of a subnet within the network.
Mtu int
The network MTU to filter. Available, when Neutron net-mtu extension is enabled.
Name string
The name of the network.
NetworkId string
The ID of the network.
Region Changes to this property will trigger replacement. string
The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve networks ids. If omitted, the region argument of the provider is used.
Status string
The status of the network.
Tags 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.
MatchingSubnetCidr string
The CIDR of a subnet within the network.
Mtu int
The network MTU to filter. Available, when Neutron net-mtu extension is enabled.
Name string
The name of the network.
NetworkId string
The ID of the network.
Region Changes to this property will trigger replacement. string
The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve networks ids. If omitted, the region argument of the provider is used.
Status string
The status of the network.
Tags []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.
matchingSubnetCidr String
The CIDR of a subnet within the network.
mtu Integer
The network MTU to filter. Available, when Neutron net-mtu extension is enabled.
name String
The name of the network.
networkId String
The ID of the network.
region Changes to this property will trigger replacement. String
The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve networks ids. If omitted, the region argument of the provider is used.
status String
The status of the network.
tags 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.
matchingSubnetCidr string
The CIDR of a subnet within the network.
mtu number
The network MTU to filter. Available, when Neutron net-mtu extension is enabled.
name string
The name of the network.
networkId string
The ID of the network.
region Changes to this property will trigger replacement. string
The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve networks ids. If omitted, the region argument of the provider is used.
status string
The status of the network.
tags 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_cidr str
The CIDR of a subnet within the network.
mtu int
The network MTU to filter. Available, when Neutron net-mtu extension is enabled.
name str
The name of the network.
network_id str
The ID of the network.
region Changes to this property will trigger replacement. str
The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve networks ids. If omitted, the region argument of the provider is used.
status str
The status of the network.
tags 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.
matchingSubnetCidr String
The CIDR of a subnet within the network.
mtu Number
The network MTU to filter. Available, when Neutron net-mtu extension is enabled.
name String
The name of the network.
networkId String
The ID of the network.
region Changes to this property will trigger replacement. String
The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve networks ids. If omitted, the region argument of the provider is used.
status String
The status of the network.
tags 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:

AdminStateUp string
The administrative state of the network.
AllTags List<string>
The set of string tags applied on the network.
AvailabilityZoneHints List<string>
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.OpenStack.Networking.Outputs.GetNetworkSegment>
An array of one or more provider segment objects.
Shared 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.
MatchingSubnetCidr string
Mtu int
See Argument Reference above.
Name string
See Argument Reference above.
NetworkId string
Status string
Tags List<string>
TenantId string
TransparentVlan bool
See Argument Reference above.
AdminStateUp string
The administrative state of the network.
AllTags []string
The set of string tags applied on the network.
AvailabilityZoneHints []string
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 []GetNetworkSegment
An array of one or more provider segment objects.
Shared 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.
MatchingSubnetCidr string
Mtu int
See Argument Reference above.
Name string
See Argument Reference above.
NetworkId string
Status string
Tags []string
TenantId string
TransparentVlan bool
See Argument Reference above.
adminStateUp String
The administrative state of the network.
allTags List<String>
The set of string tags applied on the network.
availabilityZoneHints List<String>
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<GetNetworkSegment>
An array of one or more provider segment objects.
shared 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.
matchingSubnetCidr String
mtu Integer
See Argument Reference above.
name String
See Argument Reference above.
networkId String
status String
tags List<String>
tenantId String
transparentVlan Boolean
See Argument Reference above.
adminStateUp string
The administrative state of the network.
allTags string[]
The set of string tags applied on the network.
availabilityZoneHints string[]
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 GetNetworkSegment[]
An array of one or more provider segment objects.
shared 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.
matchingSubnetCidr string
mtu number
See Argument Reference above.
name string
See Argument Reference above.
networkId string
status string
tags string[]
tenantId string
transparentVlan boolean
See Argument Reference above.
admin_state_up str
The administrative state of the network.
all_tags Sequence[str]
The set of string tags applied on the network.
availability_zone_hints Sequence[str]
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[GetNetworkSegment]
An array of one or more provider segment objects.
shared 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_cidr str
mtu int
See Argument Reference above.
name str
See Argument Reference above.
network_id str
status str
tags Sequence[str]
tenant_id str
transparent_vlan bool
See Argument Reference above.
adminStateUp String
The administrative state of the network.
allTags List<String>
The set of string tags applied on the network.
availabilityZoneHints List<String>
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.
shared 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.
matchingSubnetCidr String
mtu Number
See Argument Reference above.
name String
See Argument Reference above.
networkId String
status String
tags List<String>
tenantId String
transparentVlan Boolean
See Argument Reference above.

Supporting Types

GetNetworkSegment

NetworkType This property is required. string
PhysicalNetwork This property is required. string
SegmentationId This property is required. int
NetworkType This property is required. string
PhysicalNetwork This property is required. string
SegmentationId This property is required. int
networkType This property is required. String
physicalNetwork This property is required. String
segmentationId This property is required. Integer
networkType This property is required. string
physicalNetwork This property is required. string
segmentationId This property is required. number
network_type This property is required. str
physical_network This property is required. str
segmentation_id This property is required. int
networkType This property is required. String
physicalNetwork This property is required. String
segmentationId This property is required. Number

Package Details

Repository
OpenStack pulumi/pulumi-openstack
License
Apache-2.0
Notes
This Pulumi package is based on the openstack Terraform Provider.
OpenStack v5.0.3 published on Wednesday, Feb 12, 2025 by Pulumi