gcp.compute.getRouter
Explore with Pulumi AI
Get a router within GCE from its name and VPC.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var my_router = Gcp.Compute.GetRouter.Invoke(new()
{
Name = "myrouter-us-east1",
Network = "my-network",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.LookupRouter(ctx, &compute.LookupRouterArgs{
Name: "myrouter-us-east1",
Network: "my-network",
}, 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.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 my-router = ComputeFunctions.getRouter(GetRouterArgs.builder()
.name("myrouter-us-east1")
.network("my-network")
.build());
}
}
import pulumi
import pulumi_gcp as gcp
my_router = gcp.compute.get_router(name="myrouter-us-east1",
network="my-network")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const my-router = gcp.compute.getRouter({
name: "myrouter-us-east1",
network: "my-network",
});
variables:
my-router:
fn::invoke:
Function: gcp:compute:getRouter
Arguments:
name: myrouter-us-east1
network: my-network
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(name: Optional[str] = None,
network: Optional[str] = None,
project: Optional[str] = None,
region: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRouterResult
def get_router_output(name: Optional[pulumi.Input[str]] = None,
network: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
region: 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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: gcp:compute/getRouter:getRouter
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
The name of the router.
- Network string
The VPC network on which this router lives.
- 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.
- Network string
The VPC network on which this router lives.
- 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.
- network String
The VPC network on which this router lives.
- 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.
- network string
The VPC network on which this router lives.
- 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.
- network str
The VPC network on which this router lives.
- 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.
- network String
The VPC network on which this router lives.
- 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.
getRouter Result
The following output properties are available:
- Bgps
List<Get
Router Bgp> - Creation
Timestamp string - Description string
- Encrypted
Interconnect boolRouter - Id string
The provider-assigned unique ID for this managed resource.
- Name string
- Network string
- Self
Link string - Project string
- Region string
- Bgps
[]Get
Router Bgp - Creation
Timestamp string - Description string
- Encrypted
Interconnect boolRouter - Id string
The provider-assigned unique ID for this managed resource.
- Name string
- Network string
- Self
Link string - Project string
- Region string
- bgps
List<Get
Router Bgp> - creation
Timestamp String - description String
- encrypted
Interconnect BooleanRouter - id String
The provider-assigned unique ID for this managed resource.
- name String
- network String
- self
Link String - project String
- region String
- bgps
Get
Router Bgp[] - creation
Timestamp string - description string
- encrypted
Interconnect booleanRouter - id string
The provider-assigned unique ID for this managed resource.
- name string
- network string
- self
Link string - project string
- region string
- bgps
Sequence[Get
Router Bgp] - creation_
timestamp str - description str
- encrypted_
interconnect_ boolrouter - id str
The provider-assigned unique ID for this managed resource.
- name str
- network str
- self_
link str - project str
- region str
- bgps List<Property Map>
- creation
Timestamp String - description String
- encrypted
Interconnect BooleanRouter - id String
The provider-assigned unique ID for this managed resource.
- name String
- network String
- self
Link String - project String
- region String
Supporting Types
GetRouterBgp
- Advertise
Mode string - Advertised
Groups List<string> - Advertised
Ip List<GetRanges Router Bgp Advertised Ip Range> - Asn int
- Keepalive
Interval int
- Advertise
Mode string - Advertised
Groups []string - Advertised
Ip []GetRanges Router Bgp Advertised Ip Range - Asn int
- Keepalive
Interval int
- advertise
Mode String - advertised
Groups List<String> - advertised
Ip List<GetRanges Router Bgp Advertised Ip Range> - asn Integer
- keepalive
Interval Integer
- advertise
Mode string - advertised
Groups string[] - advertised
Ip GetRanges Router Bgp Advertised Ip Range[] - asn number
- keepalive
Interval number
- advertise
Mode String - advertised
Groups List<String> - advertised
Ip List<Property Map>Ranges - asn Number
- keepalive
Interval Number
GetRouterBgpAdvertisedIpRange
- Description string
- Range string
- Description string
- Range string
- description String
- range String
- description string
- range string
- description str
- range str
- description String
- range 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.