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:
- Admin
State 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.
- Enable
Snat 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. - Router
Id 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.
- Tenant
Id string - The owner of the router.
- Admin
State 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.
- Enable
Snat 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. - Router
Id string - The UUID of the router resource.
- Status string
- The status of the router (ACTIVE/DOWN).
- []string
- The list of router tags to filter.
- Tenant
Id string - The owner of the router.
- admin
State 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.
- enable
Snat 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. - router
Id 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.
- tenant
Id String - The owner of the router.
- admin
State 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.
- enable
Snat 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. - router
Id string - The UUID of the router resource.
- status string
- The status of the router (ACTIVE/DOWN).
- string[]
- The list of router tags to filter.
- tenant
Id 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.
- admin
State 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.
- enable
Snat 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. - router
Id 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.
- tenant
Id 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.
- Availability
Zone List<string>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 List<Pulumi.Ips Open Stack. Networking. Outputs. Get Router External Fixed Ip> - The external fixed IPs of the router.
- External
Network stringId - The network UUID of an external gateway for the router.
- External
Qos 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.
- Admin
State boolUp - Description string
- Distributed bool
- Name string
- Region string
- Router
Id string - Status string
- List<string>
- Tenant
Id string
- []string
- The set of string tags applied on the router.
- Availability
Zone []stringHints - 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 []GetIps Router External Fixed Ip - The external fixed IPs of the router.
- External
Network stringId - The network UUID of an external gateway for the router.
- External
Qos 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
[]Get
Router Route Type - The list of static routes set on the router.
- Admin
State boolUp - Description string
- Distributed bool
- Name string
- Region string
- Router
Id string - Status string
- []string
- Tenant
Id string
- List<String>
- The set of string tags applied on the router.
- availability
Zone List<String>Hints - The availability zone that is used to make router resources highly available.
- enable
Snat Boolean - The value that points out if the Source NAT is enabled on the router.
- external
Fixed List<GetIps Router External Fixed Ip> - The external fixed IPs of the router.
- external
Network StringId - The network UUID of an external gateway for the router.
- external
Qos 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<Get
Router Route> - The list of static routes set on the router.
- admin
State BooleanUp - description String
- distributed Boolean
- name String
- region String
- router
Id String - status String
- List<String>
- tenant
Id String
- string[]
- The set of string tags applied on the router.
- availability
Zone string[]Hints - The availability zone that is used to make router resources highly available.
- enable
Snat boolean - The value that points out if the Source NAT is enabled on the router.
- external
Fixed GetIps Router External Fixed Ip[] - The external fixed IPs of the router.
- external
Network stringId - The network UUID of an external gateway for the router.
- external
Qos 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
Get
Router Route[] - The list of static routes set on the router.
- admin
State booleanUp - description string
- distributed boolean
- name string
- region string
- router
Id string - status string
- string[]
- tenant
Id 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[Get
Router 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.
- availability
Zone List<String>Hints - The availability zone that is used to make router resources highly available.
- enable
Snat Boolean - The value that points out if the Source NAT is enabled on the router.
- external
Fixed List<Property Map>Ips - The external fixed IPs of the router.
- external
Network StringId - The network UUID of an external gateway for the router.
- external
Qos 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.
- admin
State BooleanUp - description String
- distributed Boolean
- name String
- region String
- router
Id String - status String
- List<String>
- tenant
Id 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
- Destination
Cidr string - Next
Hop string
- Destination
Cidr string - Next
Hop string
- destination
Cidr String - next
Hop String
- destination
Cidr string - next
Hop string
- destination_
cidr str - next_
hop str
- destination
Cidr String - next
Hop String
Package Details
- Repository
- OpenStack pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
openstackTerraform Provider.
