title: "getRouteTable" title_tag: "huaweicloud.Vpc.getRouteTable" meta_desc: "Documentation for the huaweicloud.Vpc.getRouteTable function with examples, input properties, output properties, and supporting types." layout: api no_edit_this_page: true


Provides details about a specific VPC route table.

## Example Usage
using System.Collections.Generic;
using Pulumi;
using Huaweicloud = Pulumi.Huaweicloud;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var vpcId = config.RequireObject<dynamic>("vpcId");
    var @default = Huaweicloud.Vpc.GetRouteTable.Invoke(new()
    {
        VpcId = vpcId,
    });

    var custom = Huaweicloud.Vpc.GetRouteTable.Invoke(new()
    {
        VpcId = vpcId,
        Name = "demo",
    });

});
package main

import (
    "github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Vpc"
    "github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/Vpc"
    "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        cfg := config.New(ctx, "")
        vpcId := cfg.RequireObject("vpcId")
        _, err := Vpc.GetRouteTable(ctx, &vpc.GetRouteTableArgs{
            VpcId: vpcId,
        }, nil)
        if err != nil {
            return err
        }
        _, err = Vpc.GetRouteTable(ctx, &vpc.GetRouteTableArgs{
            VpcId: vpcId,
            Name:  pulumi.StringRef("demo"),
        }, 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.huaweicloud.Vpc.VpcFunctions;
import com.pulumi.huaweicloud.Vpc.inputs.GetRouteTableArgs;
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 config = ctx.config();
        final var vpcId = config.get("vpcId");
        final var default = VpcFunctions.getRouteTable(GetRouteTableArgs.builder()
            .vpcId(vpcId)
            .build());

        final var custom = VpcFunctions.getRouteTable(GetRouteTableArgs.builder()
            .vpcId(vpcId)
            .name("demo")
            .build());

    }
}
import pulumi
import pulumi_huaweicloud as huaweicloud

config = pulumi.Config()
vpc_id = config.require_object("vpcId")
default = huaweicloud.Vpc.get_route_table(vpc_id=vpc_id)
custom = huaweicloud.Vpc.get_route_table(vpc_id=vpc_id,
    name="demo")
import * as pulumi from "@pulumi/pulumi";
import * as huaweicloud from "@pulumi/huaweicloud";

const config = new pulumi.Config();
const vpcId = config.requireObject("vpcId");
const default = huaweicloud.Vpc.getRouteTable({
    vpcId: vpcId,
});
const custom = huaweicloud.Vpc.getRouteTable({
    vpcId: vpcId,
    name: "demo",
});
configuration:
  vpcId:
    type: dynamic
variables:
  default:
    Fn::Invoke:
      Function: huaweicloud:Vpc:getRouteTable
      Arguments:
        vpcId: ${vpcId}
  custom:
    Fn::Invoke:
      Function: huaweicloud:Vpc:getRouteTable
      Arguments:
        vpcId: ${vpcId}
        name: demo

Using getRouteTable {#using}

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 getRouteTable(args: GetRouteTableArgs, opts?: InvokeOptions): Promise<GetRouteTableResult>
function getRouteTableOutput(args: GetRouteTableOutputArgs, opts?: InvokeOptions): Output<GetRouteTableResult>
def get_route_table(id: Optional[str] = None,
                    name: Optional[str] = None,
                    region: Optional[str] = None,
                    vpc_id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetRouteTableResult
def get_route_table_output(id: Optional[pulumi.Input[str]] = None,
                    name: Optional[pulumi.Input[str]] = None,
                    region: Optional[pulumi.Input[str]] = None,
                    vpc_id: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetRouteTableResult]
func GetRouteTable(ctx *Context, args *GetRouteTableArgs, opts ...InvokeOption) (*GetRouteTableResult, error)
func GetRouteTableOutput(ctx *Context, args *GetRouteTableOutputArgs, opts ...InvokeOption) GetRouteTableResultOutput

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

public static class GetRouteTable 
{
    public static Task<GetRouteTableResult> InvokeAsync(GetRouteTableArgs args, InvokeOptions? opts = null)
    public static Output<GetRouteTableResult> Invoke(GetRouteTableInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRouteTableResult> getRouteTable(GetRouteTableArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: huaweicloud:Vpc/getRouteTable:getRouteTable
  Arguments:
    # Arguments dictionary

The following arguments are supported:

VpcId string
  • Specifies the VPC ID where the route table resides.
Id string
  • Specifies the ID of the route table.
Name string
  • Specifies the name of the route table.
Region string

The region in which to query the vpc route table. If omitted, the provider-level region will be used.

VpcId string
  • Specifies the VPC ID where the route table resides.
Id string
  • Specifies the ID of the route table.
Name string
  • Specifies the name of the route table.
Region string

The region in which to query the vpc route table. If omitted, the provider-level region will be used.

vpcId String
  • Specifies the VPC ID where the route table resides.
id String
  • Specifies the ID of the route table.
name String
  • Specifies the name of the route table.
region String

The region in which to query the vpc route table. If omitted, the provider-level region will be used.

vpcId string
  • Specifies the VPC ID where the route table resides.
id string
  • Specifies the ID of the route table.
name string
  • Specifies the name of the route table.
region string

The region in which to query the vpc route table. If omitted, the provider-level region will be used.

vpc_id str
  • Specifies the VPC ID where the route table resides.
id str
  • Specifies the ID of the route table.
name str
  • Specifies the name of the route table.
region str

The region in which to query the vpc route table. If omitted, the provider-level region will be used.

vpcId String
  • Specifies the VPC ID where the route table resides.
id String
  • Specifies the ID of the route table.
name String
  • Specifies the name of the route table.
region String

The region in which to query the vpc route table. If omitted, the provider-level region will be used.

getRouteTable Result {#result}

The following output properties are available:

Default bool
Description string
Id string
Name string
Region string
Routes List<GetRouteTableRoute>
Subnets List<string>
VpcId string
Default bool
Description string
Id string
Name string
Region string
Routes []GetRouteTableRoute
Subnets []string
VpcId string
default_ Boolean
description String
id String
name String
region String
routes List<GetRouteTableRoute>
subnets List<String>
vpcId String
default boolean
description string
id string
name string
region string
routes GetRouteTableRoute[]
subnets string[]
vpcId string
default bool
description str
id str
name str
region str
routes GetRouteTableRoute]
subnets Sequence[str]
vpc_id str
default Boolean
description String
id String
name String
region String
routes List<Property Map>
subnets List<String>
vpcId String

Supporting Types

GetRouteTableRoute

Description string
Destination string
Nexthop string
Type string
Description string
Destination string
Nexthop string
Type string
description String
destination String
nexthop String
type String
description string
destination string
nexthop string
type string
description String
destination String
nexthop String
type String

Package Details

Repository
https://github.com/huaweicloud/pulumi-huaweicloud
License
Apache-2.0
Notes

This Pulumi package is based on the huaweicloud Terraform Provider.