1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. getRouter
Google Cloud Classic v7.2.1 published on Wednesday, Nov 22, 2023 by Pulumi

gcp.compute.getRouter

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.2.1 published on Wednesday, Nov 22, 2023 by Pulumi

    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<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

    GetRouterBgpAdvertisedIpRange

    Description string
    Range string
    Description string
    Range string
    description String
    range String
    description string
    range string
    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.

    gcp logo
    Google Cloud Classic v7.2.1 published on Wednesday, Nov 22, 2023 by Pulumi