1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. getRouter
Google Cloud Classic v7.16.0 published on Wednesday, Mar 27, 2024 by Pulumi

gcp.compute.getRouter

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.16.0 published on Wednesday, Mar 27, 2024 by Pulumi

    Get a router within GCE from its name and VPC.

    Example Usage

    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",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    my_router = gcp.compute.get_router(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
    	})
    }
    
    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 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());
    
        }
    }
    
    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<GetRouterBgp>
    CreationTimestamp string
    Description string
    EncryptedInterconnectRouter bool
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Network string
    SelfLink string
    Project string
    Region string
    Bgps []GetRouterBgp
    CreationTimestamp string
    Description string
    EncryptedInterconnectRouter bool
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Network string
    SelfLink string
    Project string
    Region string
    bgps List<GetRouterBgp>
    creationTimestamp String
    description String
    encryptedInterconnectRouter Boolean
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    network String
    selfLink String
    project String
    region String
    bgps GetRouterBgp[]
    creationTimestamp string
    description string
    encryptedInterconnectRouter boolean
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    network string
    selfLink string
    project string
    region string
    bgps Sequence[GetRouterBgp]
    creation_timestamp str
    description str
    encrypted_interconnect_router bool
    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>
    creationTimestamp String
    description String
    encryptedInterconnectRouter Boolean
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    network String
    selfLink String
    project String
    region String

    Supporting Types

    GetRouterBgp

    AdvertiseMode string
    User-specified flag to indicate which mode to use for advertisement. Default value: "DEFAULT" Possible values: ["DEFAULT", "CUSTOM"]
    AdvertisedGroups List<string>

    User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertiseMode is CUSTOM and is advertised to all peers of the router. These groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.

    This enum field has the one valid value: ALL_SUBNETS

    AdvertisedIpRanges List<GetRouterBgpAdvertisedIpRange>
    User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertiseMode is CUSTOM and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges.
    Asn int
    Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN.
    KeepaliveInterval int

    The interval in seconds between BGP keepalive messages that are sent to the peer. Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer.

    BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers. If set, this value must be between 20 and 60. The default is 20.

    AdvertiseMode string
    User-specified flag to indicate which mode to use for advertisement. Default value: "DEFAULT" Possible values: ["DEFAULT", "CUSTOM"]
    AdvertisedGroups []string

    User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertiseMode is CUSTOM and is advertised to all peers of the router. These groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.

    This enum field has the one valid value: ALL_SUBNETS

    AdvertisedIpRanges []GetRouterBgpAdvertisedIpRange
    User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertiseMode is CUSTOM and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges.
    Asn int
    Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN.
    KeepaliveInterval int

    The interval in seconds between BGP keepalive messages that are sent to the peer. Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer.

    BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers. If set, this value must be between 20 and 60. The default is 20.

    advertiseMode String
    User-specified flag to indicate which mode to use for advertisement. Default value: "DEFAULT" Possible values: ["DEFAULT", "CUSTOM"]
    advertisedGroups List<String>

    User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertiseMode is CUSTOM and is advertised to all peers of the router. These groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.

    This enum field has the one valid value: ALL_SUBNETS

    advertisedIpRanges List<GetRouterBgpAdvertisedIpRange>
    User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertiseMode is CUSTOM and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges.
    asn Integer
    Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN.
    keepaliveInterval Integer

    The interval in seconds between BGP keepalive messages that are sent to the peer. Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer.

    BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers. If set, this value must be between 20 and 60. The default is 20.

    advertiseMode string
    User-specified flag to indicate which mode to use for advertisement. Default value: "DEFAULT" Possible values: ["DEFAULT", "CUSTOM"]
    advertisedGroups string[]

    User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertiseMode is CUSTOM and is advertised to all peers of the router. These groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.

    This enum field has the one valid value: ALL_SUBNETS

    advertisedIpRanges GetRouterBgpAdvertisedIpRange[]
    User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertiseMode is CUSTOM and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges.
    asn number
    Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN.
    keepaliveInterval number

    The interval in seconds between BGP keepalive messages that are sent to the peer. Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer.

    BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers. If set, this value must be between 20 and 60. The default is 20.

    str
    User-specified flag to indicate which mode to use for advertisement. Default value: "DEFAULT" Possible values: ["DEFAULT", "CUSTOM"]
    advertised_groups Sequence[str]

    User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertiseMode is CUSTOM and is advertised to all peers of the router. These groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.

    This enum field has the one valid value: ALL_SUBNETS

    advertised_ip_ranges Sequence[GetRouterBgpAdvertisedIpRange]
    User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertiseMode is CUSTOM and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges.
    asn int
    Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN.
    keepalive_interval int

    The interval in seconds between BGP keepalive messages that are sent to the peer. Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer.

    BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers. If set, this value must be between 20 and 60. The default is 20.

    advertiseMode String
    User-specified flag to indicate which mode to use for advertisement. Default value: "DEFAULT" Possible values: ["DEFAULT", "CUSTOM"]
    advertisedGroups List<String>

    User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertiseMode is CUSTOM and is advertised to all peers of the router. These groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.

    This enum field has the one valid value: ALL_SUBNETS

    advertisedIpRanges List<Property Map>
    User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertiseMode is CUSTOM and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges.
    asn Number
    Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN.
    keepaliveInterval Number

    The interval in seconds between BGP keepalive messages that are sent to the peer. Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer.

    BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers. If set, this value must be between 20 and 60. The default is 20.

    GetRouterBgpAdvertisedIpRange

    Description string
    User-specified description for the IP range.
    Range string
    The IP range to advertise. The value must be a CIDR-formatted string.
    Description string
    User-specified description for the IP range.
    Range string
    The IP range to advertise. The value must be a CIDR-formatted string.
    description String
    User-specified description for the IP range.
    range String
    The IP range to advertise. The value must be a CIDR-formatted string.
    description string
    User-specified description for the IP range.
    range string
    The IP range to advertise. The value must be a CIDR-formatted string.
    description str
    User-specified description for the IP range.
    range str
    The IP range to advertise. The value must be a CIDR-formatted string.
    description String
    User-specified description for the IP range.
    range String
    The IP range to advertise. The value must be a CIDR-formatted 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.
    gcp logo
    Google Cloud Classic v7.16.0 published on Wednesday, Mar 27, 2024 by Pulumi