gcp.compute.getRouterStatus

Explore with Pulumi AI

Get a Cloud Router’s status within GCE from its name and region. This data source exposes the routes learned by a Cloud Router via BGP peers.

For more information see the official documentation and API.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var my_router = Gcp.Compute.GetRouterStatus.Invoke(new()
    {
        Name = "myrouter",
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := compute.GetRouterStatus(ctx, &compute.GetRouterStatusArgs{
			Name: "myrouter",
		}, 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.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetRouterStatusArgs;
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 my-router = ComputeFunctions.getRouterStatus(GetRouterStatusArgs.builder()
            .name("myrouter")
            .build());

    }
}
import pulumi
import pulumi_gcp as gcp

my_router = gcp.compute.get_router_status(name="myrouter")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const my-router = gcp.compute.getRouterStatus({
    name: "myrouter",
});
variables:
  my-router:
    fn::invoke:
      Function: gcp:compute:getRouterStatus
      Arguments:
        name: myrouter

Using getRouterStatus

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 getRouterStatus(args: GetRouterStatusArgs, opts?: InvokeOptions): Promise<GetRouterStatusResult>
function getRouterStatusOutput(args: GetRouterStatusOutputArgs, opts?: InvokeOptions): Output<GetRouterStatusResult>
def get_router_status(name: Optional[str] = None,
                      project: Optional[str] = None,
                      region: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetRouterStatusResult
def get_router_status_output(name: Optional[pulumi.Input[str]] = None,
                      project: Optional[pulumi.Input[str]] = None,
                      region: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetRouterStatusResult]
func GetRouterStatus(ctx *Context, args *GetRouterStatusArgs, opts ...InvokeOption) (*GetRouterStatusResult, error)
func GetRouterStatusOutput(ctx *Context, args *GetRouterStatusOutputArgs, opts ...InvokeOption) GetRouterStatusResultOutput

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

public static class GetRouterStatus 
{
    public static Task<GetRouterStatusResult> InvokeAsync(GetRouterStatusArgs args, InvokeOptions? opts = null)
    public static Output<GetRouterStatusResult> Invoke(GetRouterStatusInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRouterStatusResult> getRouterStatus(GetRouterStatusArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: gcp:compute/getRouterStatus:getRouterStatus
  arguments:
    # arguments dictionary

The following arguments are supported:

Name string

The name of the router.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Region string

The region this router has been created in. If unspecified, this defaults to the region configured in the provider.

Name string

The name of the router.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Region string

The region this router has been created in. If unspecified, this defaults to the region configured in the provider.

name String

The name of the router.

project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

region String

The region this router has been created in. If unspecified, this defaults to the region configured in the provider.

name string

The name of the router.

project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

region string

The region this router has been created in. If unspecified, this defaults to the region configured in the provider.

name str

The name of the router.

project str

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

region str

The region this router has been created in. If unspecified, this defaults to the region configured in the provider.

name String

The name of the router.

project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

region String

The region this router has been created in. If unspecified, this defaults to the region configured in the provider.

getRouterStatus Result

The following output properties are available:

BestRoutes List<GetRouterStatusBestRoute>

List of best compute#routes configurations for this router's network. See gcp.compute.Route resource for available attributes.

BestRoutesForRouters List<GetRouterStatusBestRoutesForRouter>

List of best compute#routes for this specific router. See gcp.compute.Route resource for available attributes.

Id string

The provider-assigned unique ID for this managed resource.

Name string
Network string

The network name or resource link to the parent network of this subnetwork.

Region string
Project string
BestRoutes []GetRouterStatusBestRoute

List of best compute#routes configurations for this router's network. See gcp.compute.Route resource for available attributes.

BestRoutesForRouters []GetRouterStatusBestRoutesForRouter

List of best compute#routes for this specific router. See gcp.compute.Route resource for available attributes.

Id string

The provider-assigned unique ID for this managed resource.

Name string
Network string

The network name or resource link to the parent network of this subnetwork.

Region string
Project string
bestRoutes List<GetRouterStatusBestRoute>

List of best compute#routes configurations for this router's network. See gcp.compute.Route resource for available attributes.

bestRoutesForRouters List<GetRouterStatusBestRoutesForRouter>

List of best compute#routes for this specific router. See gcp.compute.Route resource for available attributes.

id String

The provider-assigned unique ID for this managed resource.

name String
network String

The network name or resource link to the parent network of this subnetwork.

region String
project String
bestRoutes GetRouterStatusBestRoute[]

List of best compute#routes configurations for this router's network. See gcp.compute.Route resource for available attributes.

bestRoutesForRouters GetRouterStatusBestRoutesForRouter[]

List of best compute#routes for this specific router. See gcp.compute.Route resource for available attributes.

id string

The provider-assigned unique ID for this managed resource.

name string
network string

The network name or resource link to the parent network of this subnetwork.

region string
project string
best_routes Sequence[GetRouterStatusBestRoute]

List of best compute#routes configurations for this router's network. See gcp.compute.Route resource for available attributes.

best_routes_for_routers Sequence[GetRouterStatusBestRoutesForRouter]

List of best compute#routes for this specific router. See gcp.compute.Route resource for available attributes.

id str

The provider-assigned unique ID for this managed resource.

name str
network str

The network name or resource link to the parent network of this subnetwork.

region str
project str
bestRoutes List<Property Map>

List of best compute#routes configurations for this router's network. See gcp.compute.Route resource for available attributes.

bestRoutesForRouters List<Property Map>

List of best compute#routes for this specific router. See gcp.compute.Route resource for available attributes.

id String

The provider-assigned unique ID for this managed resource.

name String
network String

The network name or resource link to the parent network of this subnetwork.

region String
project String

Supporting Types

GetRouterStatusBestRoute

Description string
DestRange string
Name string

The name of the router.

Network string

The network name or resource link to the parent network of this subnetwork.

NextHopGateway string
NextHopIlb string
NextHopInstance string
NextHopInstanceZone string
NextHopIp string
NextHopNetwork string
NextHopVpnTunnel string
Priority int
Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

SelfLink string
Tags List<string>
Description string
DestRange string
Name string

The name of the router.

Network string

The network name or resource link to the parent network of this subnetwork.

NextHopGateway string
NextHopIlb string
NextHopInstance string
NextHopInstanceZone string
NextHopIp string
NextHopNetwork string
NextHopVpnTunnel string
Priority int
Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

SelfLink string
Tags []string
description String
destRange String
name String

The name of the router.

network String

The network name or resource link to the parent network of this subnetwork.

nextHopGateway String
nextHopIlb String
nextHopInstance String
nextHopInstanceZone String
nextHopIp String
nextHopNetwork String
nextHopVpnTunnel String
priority Integer
project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

selfLink String
tags List<String>
description string
destRange string
name string

The name of the router.

network string

The network name or resource link to the parent network of this subnetwork.

nextHopGateway string
nextHopIlb string
nextHopInstance string
nextHopInstanceZone string
nextHopIp string
nextHopNetwork string
nextHopVpnTunnel string
priority number
project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

selfLink string
tags string[]
description str
dest_range str
name str

The name of the router.

network str

The network name or resource link to the parent network of this subnetwork.

next_hop_gateway str
next_hop_ilb str
next_hop_instance str
next_hop_instance_zone str
next_hop_ip str
next_hop_network str
next_hop_vpn_tunnel str
priority int
project str

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

self_link str
tags Sequence[str]
description String
destRange String
name String

The name of the router.

network String

The network name or resource link to the parent network of this subnetwork.

nextHopGateway String
nextHopIlb String
nextHopInstance String
nextHopInstanceZone String
nextHopIp String
nextHopNetwork String
nextHopVpnTunnel String
priority Number
project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

selfLink String
tags List<String>

GetRouterStatusBestRoutesForRouter

Description string
DestRange string
Name string

The name of the router.

Network string

The network name or resource link to the parent network of this subnetwork.

NextHopGateway string
NextHopIlb string
NextHopInstance string
NextHopInstanceZone string
NextHopIp string
NextHopNetwork string
NextHopVpnTunnel string
Priority int
Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

SelfLink string
Tags List<string>
Description string
DestRange string
Name string

The name of the router.

Network string

The network name or resource link to the parent network of this subnetwork.

NextHopGateway string
NextHopIlb string
NextHopInstance string
NextHopInstanceZone string
NextHopIp string
NextHopNetwork string
NextHopVpnTunnel string
Priority int
Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

SelfLink string
Tags []string
description String
destRange String
name String

The name of the router.

network String

The network name or resource link to the parent network of this subnetwork.

nextHopGateway String
nextHopIlb String
nextHopInstance String
nextHopInstanceZone String
nextHopIp String
nextHopNetwork String
nextHopVpnTunnel String
priority Integer
project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

selfLink String
tags List<String>
description string
destRange string
name string

The name of the router.

network string

The network name or resource link to the parent network of this subnetwork.

nextHopGateway string
nextHopIlb string
nextHopInstance string
nextHopInstanceZone string
nextHopIp string
nextHopNetwork string
nextHopVpnTunnel string
priority number
project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

selfLink string
tags string[]
description str
dest_range str
name str

The name of the router.

network str

The network name or resource link to the parent network of this subnetwork.

next_hop_gateway str
next_hop_ilb str
next_hop_instance str
next_hop_instance_zone str
next_hop_ip str
next_hop_network str
next_hop_vpn_tunnel str
priority int
project str

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

self_link str
tags Sequence[str]
description String
destRange String
name String

The name of the router.

network String

The network name or resource link to the parent network of this subnetwork.

nextHopGateway String
nextHopIlb String
nextHopInstance String
nextHopInstanceZone String
nextHopIp String
nextHopNetwork String
nextHopVpnTunnel String
priority Number
project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

selfLink String
tags List<String>

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes

This Pulumi package is based on the google-beta Terraform Provider.