OpenStack v5.3.3 published on Friday, Sep 12, 2025 by Pulumi
openstack.networking.getRouter
Use this data source to get the ID of an available OpenStack router.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const router = openstack.networking.getRouter({
    name: "router_1",
});
import pulumi
import pulumi_openstack as openstack
router = openstack.networking.get_router(name="router_1")
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.LookupRouter(ctx, &networking.LookupRouterArgs{
			Name: pulumi.StringRef("router_1"),
		}, 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 router = OpenStack.Networking.GetRouter.Invoke(new()
    {
        Name = "router_1",
    });
});
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.GetRouterArgs;
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 router = NetworkingFunctions.getRouter(GetRouterArgs.builder()
            .name("router_1")
            .build());
    }
}
variables:
  router:
    fn::invoke:
      function: openstack:networking:getRouter
      arguments:
        name: router_1
Using getRouter
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 getRouter(args: GetRouterArgs, opts?: InvokeOptions): Promise<GetRouterResult>
function getRouterOutput(args: GetRouterOutputArgs, opts?: InvokeOptions): Output<GetRouterResult>def get_router(admin_state_up: Optional[bool] = None,
               description: Optional[str] = None,
               distributed: Optional[bool] = None,
               enable_snat: Optional[bool] = None,
               name: Optional[str] = None,
               region: Optional[str] = None,
               router_id: Optional[str] = None,
               status: Optional[str] = None,
               tags: Optional[Sequence[str]] = None,
               tenant_id: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetRouterResult
def get_router_output(admin_state_up: Optional[pulumi.Input[bool]] = None,
               description: Optional[pulumi.Input[str]] = None,
               distributed: Optional[pulumi.Input[bool]] = None,
               enable_snat: Optional[pulumi.Input[bool]] = None,
               name: Optional[pulumi.Input[str]] = None,
               region: Optional[pulumi.Input[str]] = None,
               router_id: 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,
               opts: Optional[InvokeOptions] = None) -> Output[GetRouterResult]func LookupRouter(ctx *Context, args *LookupRouterArgs, opts ...InvokeOption) (*LookupRouterResult, error)
func LookupRouterOutput(ctx *Context, args *LookupRouterOutputArgs, opts ...InvokeOption) LookupRouterResultOutput> Note: This function is named LookupRouter in the Go SDK.
public static class GetRouter 
{
    public static Task<GetRouterResult> InvokeAsync(GetRouterArgs args, InvokeOptions? opts = null)
    public static Output<GetRouterResult> Invoke(GetRouterInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetRouterResult> getRouter(GetRouterArgs args, InvokeOptions options)
public static Output<GetRouterResult> getRouter(GetRouterArgs args, InvokeOptions options)
fn::invoke:
  function: openstack:networking/getRouter:getRouter
  arguments:
    # arguments dictionaryThe following arguments are supported:
- AdminState boolUp 
- Administrative up/down status for the router (must be "true" or "false" if provided).
- Description string
- Human-readable description of the router.
- Distributed bool
- Indicates whether or not to get a distributed router.
- EnableSnat bool
- The value that points out if the Source NAT is enabled on the router.
- Name string
- The name of the router.
- Region string
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve router ids. If omitted, the
regionargument of the provider is used.
- RouterId string
- The UUID of the router resource.
- Status string
- The status of the router (ACTIVE/DOWN).
- List<string>
- The list of router tags to filter.
- TenantId string
- The owner of the router.
- AdminState boolUp 
- Administrative up/down status for the router (must be "true" or "false" if provided).
- Description string
- Human-readable description of the router.
- Distributed bool
- Indicates whether or not to get a distributed router.
- EnableSnat bool
- The value that points out if the Source NAT is enabled on the router.
- Name string
- The name of the router.
- Region string
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve router ids. If omitted, the
regionargument of the provider is used.
- RouterId string
- The UUID of the router resource.
- Status string
- The status of the router (ACTIVE/DOWN).
- []string
- The list of router tags to filter.
- TenantId string
- The owner of the router.
- adminState BooleanUp 
- Administrative up/down status for the router (must be "true" or "false" if provided).
- description String
- Human-readable description of the router.
- distributed Boolean
- Indicates whether or not to get a distributed router.
- enableSnat Boolean
- The value that points out if the Source NAT is enabled on the router.
- name String
- The name of the router.
- region String
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve router ids. If omitted, the
regionargument of the provider is used.
- routerId String
- The UUID of the router resource.
- status String
- The status of the router (ACTIVE/DOWN).
- List<String>
- The list of router tags to filter.
- tenantId String
- The owner of the router.
- adminState booleanUp 
- Administrative up/down status for the router (must be "true" or "false" if provided).
- description string
- Human-readable description of the router.
- distributed boolean
- Indicates whether or not to get a distributed router.
- enableSnat boolean
- The value that points out if the Source NAT is enabled on the router.
- name string
- The name of the router.
- region string
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve router ids. If omitted, the
regionargument of the provider is used.
- routerId string
- The UUID of the router resource.
- status string
- The status of the router (ACTIVE/DOWN).
- string[]
- The list of router tags to filter.
- tenantId string
- The owner of the router.
- admin_state_ boolup 
- Administrative up/down status for the router (must be "true" or "false" if provided).
- description str
- Human-readable description of the router.
- distributed bool
- Indicates whether or not to get a distributed router.
- enable_snat bool
- The value that points out if the Source NAT is enabled on the router.
- name str
- The name of the router.
- region str
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve router ids. If omitted, the
regionargument of the provider is used.
- router_id str
- The UUID of the router resource.
- status str
- The status of the router (ACTIVE/DOWN).
- Sequence[str]
- The list of router tags to filter.
- tenant_id str
- The owner of the router.
- adminState BooleanUp 
- Administrative up/down status for the router (must be "true" or "false" if provided).
- description String
- Human-readable description of the router.
- distributed Boolean
- Indicates whether or not to get a distributed router.
- enableSnat Boolean
- The value that points out if the Source NAT is enabled on the router.
- name String
- The name of the router.
- region String
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve router ids. If omitted, the
regionargument of the provider is used.
- routerId String
- The UUID of the router resource.
- status String
- The status of the router (ACTIVE/DOWN).
- List<String>
- The list of router tags to filter.
- tenantId String
- The owner of the router.
getRouter Result
The following output properties are available:
- List<string>
- The set of string tags applied on the router.
- AvailabilityZone List<string>Hints 
- The availability zone that is used to make router resources highly available.
- EnableSnat bool
- The value that points out if the Source NAT is enabled on the router.
- ExternalFixed List<Pulumi.Ips Open Stack. Networking. Outputs. Get Router External Fixed Ip> 
- The external fixed IPs of the router.
- ExternalNetwork stringId 
- The network UUID of an external gateway for the router.
- ExternalQos stringPolicy Id 
- The QoS policy UUID applied on the external gateway for the router.
- Id string
- The provider-assigned unique ID for this managed resource.
- Routes
List<Pulumi.Open Stack. Networking. Outputs. Get Router Route> 
- The list of static routes set on the router.
- AdminState boolUp 
- Description string
- Distributed bool
- Name string
- Region string
- RouterId string
- Status string
- List<string>
- TenantId string
- []string
- The set of string tags applied on the router.
- AvailabilityZone []stringHints 
- The availability zone that is used to make router resources highly available.
- EnableSnat bool
- The value that points out if the Source NAT is enabled on the router.
- ExternalFixed []GetIps Router External Fixed Ip 
- The external fixed IPs of the router.
- ExternalNetwork stringId 
- The network UUID of an external gateway for the router.
- ExternalQos stringPolicy Id 
- The QoS policy UUID applied on the external gateway for the router.
- Id string
- The provider-assigned unique ID for this managed resource.
- Routes
[]GetRouter Route Type 
- The list of static routes set on the router.
- AdminState boolUp 
- Description string
- Distributed bool
- Name string
- Region string
- RouterId string
- Status string
- []string
- TenantId string
- List<String>
- The set of string tags applied on the router.
- availabilityZone List<String>Hints 
- The availability zone that is used to make router resources highly available.
- enableSnat Boolean
- The value that points out if the Source NAT is enabled on the router.
- externalFixed List<GetIps Router External Fixed Ip> 
- The external fixed IPs of the router.
- externalNetwork StringId 
- The network UUID of an external gateway for the router.
- externalQos StringPolicy Id 
- The QoS policy UUID applied on the external gateway for the router.
- id String
- The provider-assigned unique ID for this managed resource.
- routes
List<GetRouter Route> 
- The list of static routes set on the router.
- adminState BooleanUp 
- description String
- distributed Boolean
- name String
- region String
- routerId String
- status String
- List<String>
- tenantId String
- string[]
- The set of string tags applied on the router.
- availabilityZone string[]Hints 
- The availability zone that is used to make router resources highly available.
- enableSnat boolean
- The value that points out if the Source NAT is enabled on the router.
- externalFixed GetIps Router External Fixed Ip[] 
- The external fixed IPs of the router.
- externalNetwork stringId 
- The network UUID of an external gateway for the router.
- externalQos stringPolicy Id 
- The QoS policy UUID applied on the external gateway for the router.
- id string
- The provider-assigned unique ID for this managed resource.
- routes
GetRouter Route[] 
- The list of static routes set on the router.
- adminState booleanUp 
- description string
- distributed boolean
- name string
- region string
- routerId string
- status string
- string[]
- tenantId string
- Sequence[str]
- The set of string tags applied on the router.
- availability_zone_ Sequence[str]hints 
- The availability zone that is used to make router resources highly available.
- enable_snat bool
- The value that points out if the Source NAT is enabled on the router.
- external_fixed_ Sequence[Getips Router External Fixed Ip] 
- The external fixed IPs of the router.
- external_network_ strid 
- The network UUID of an external gateway for the router.
- external_qos_ strpolicy_ id 
- The QoS policy UUID applied on the external gateway for the router.
- id str
- The provider-assigned unique ID for this managed resource.
- routes
Sequence[GetRouter Route] 
- The list of static routes set on the router.
- admin_state_ boolup 
- description str
- distributed bool
- name str
- region str
- router_id str
- status str
- Sequence[str]
- tenant_id str
- List<String>
- The set of string tags applied on the router.
- availabilityZone List<String>Hints 
- The availability zone that is used to make router resources highly available.
- enableSnat Boolean
- The value that points out if the Source NAT is enabled on the router.
- externalFixed List<Property Map>Ips 
- The external fixed IPs of the router.
- externalNetwork StringId 
- The network UUID of an external gateway for the router.
- externalQos StringPolicy Id 
- The QoS policy UUID applied on the external gateway for the router.
- id String
- The provider-assigned unique ID for this managed resource.
- routes List<Property Map>
- The list of static routes set on the router.
- adminState BooleanUp 
- description String
- distributed Boolean
- name String
- region String
- routerId String
- status String
- List<String>
- tenantId String
Supporting Types
GetRouterExternalFixedIp    
- ip_address str
- The IP address to set on the router.
- subnet_id str
- Subnet in which the fixed IP belongs to.
GetRouterRoute  
- DestinationCidr string
- NextHop string
- DestinationCidr string
- NextHop string
- destinationCidr String
- nextHop String
- destinationCidr string
- nextHop string
- destination_cidr str
- next_hop str
- destinationCidr String
- nextHop String
Package Details
- Repository
- OpenStack pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the openstackTerraform Provider.
