gcp.compute.getRouter
Explore with Pulumi AI
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<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 - User-specified flag to indicate which mode to use for advertisement. Default value: "DEFAULT" Possible values: ["DEFAULT", "CUSTOM"]
- Advertised
Groups 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
- Advertised
Ip List<GetRanges Router Bgp Advertised Ip Range> - 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.
- Identifier
Range string - Explicitly specifies a range of valid BGP Identifiers for this Router. It is provided as a link-local IPv4 range (from 169.254.0.0/16), of size at least /30, even if the BGP sessions are over IPv6. It must not overlap with any IPv4 BGP session ranges. Other vendors commonly call this router ID.
- 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.
- Advertise
Mode string - User-specified flag to indicate which mode to use for advertisement. Default value: "DEFAULT" Possible values: ["DEFAULT", "CUSTOM"]
- Advertised
Groups []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
- Advertised
Ip []GetRanges Router Bgp Advertised Ip Range - 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.
- Identifier
Range string - Explicitly specifies a range of valid BGP Identifiers for this Router. It is provided as a link-local IPv4 range (from 169.254.0.0/16), of size at least /30, even if the BGP sessions are over IPv6. It must not overlap with any IPv4 BGP session ranges. Other vendors commonly call this router ID.
- 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.
- advertise
Mode String - User-specified flag to indicate which mode to use for advertisement. Default value: "DEFAULT" Possible values: ["DEFAULT", "CUSTOM"]
- advertised
Groups 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
- advertised
Ip List<GetRanges Router Bgp Advertised Ip Range> - 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.
- identifier
Range String - Explicitly specifies a range of valid BGP Identifiers for this Router. It is provided as a link-local IPv4 range (from 169.254.0.0/16), of size at least /30, even if the BGP sessions are over IPv6. It must not overlap with any IPv4 BGP session ranges. Other vendors commonly call this router ID.
- keepalive
Interval 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.
- advertise
Mode string - User-specified flag to indicate which mode to use for advertisement. Default value: "DEFAULT" Possible values: ["DEFAULT", "CUSTOM"]
- advertised
Groups 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
- advertised
Ip GetRanges Router Bgp Advertised Ip Range[] - 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.
- identifier
Range string - Explicitly specifies a range of valid BGP Identifiers for this Router. It is provided as a link-local IPv4 range (from 169.254.0.0/16), of size at least /30, even if the BGP sessions are over IPv6. It must not overlap with any IPv4 BGP session ranges. Other vendors commonly call this router ID.
- keepalive
Interval 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.
- advertise_
mode 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_ Sequence[Getranges Router Bgp Advertised Ip Range] - 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.
- identifier_
range str - Explicitly specifies a range of valid BGP Identifiers for this Router. It is provided as a link-local IPv4 range (from 169.254.0.0/16), of size at least /30, even if the BGP sessions are over IPv6. It must not overlap with any IPv4 BGP session ranges. Other vendors commonly call this router ID.
- 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.
- advertise
Mode String - User-specified flag to indicate which mode to use for advertisement. Default value: "DEFAULT" Possible values: ["DEFAULT", "CUSTOM"]
- advertised
Groups 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
- advertised
Ip List<Property Map>Ranges - 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.
- identifier
Range String - Explicitly specifies a range of valid BGP Identifiers for this Router. It is provided as a link-local IPv4 range (from 169.254.0.0/16), of size at least /30, even if the BGP sessions are over IPv6. It must not overlap with any IPv4 BGP session ranges. Other vendors commonly call this router ID.
- keepalive
Interval 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.