tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack
tencentcloud.getVpcRouteTables
Explore with Pulumi AI
tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack
Use this data source to query vpc route tables information.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const config = new pulumi.Config();
const availabilityZone = config.get("availabilityZone") || "ap-guangzhou-3";
const foo = new tencentcloud.Vpc("foo", {cidrBlock: "10.0.0.0/16"});
const routeTable = new tencentcloud.RouteTable("routeTable", {
    vpcId: foo.vpcId,
    tags: {
        test: "test",
    },
});
const idInstances = tencentcloud.getVpcRouteTablesOutput({
    routeTableId: routeTable.routeTableId,
});
const nameInstances = tencentcloud.getVpcRouteTablesOutput({
    name: routeTable.name,
});
const vpcDefaultInstance = tencentcloud.getVpcRouteTablesOutput({
    vpcId: foo.vpcId,
    associationMain: true,
});
const tagsInstances = routeTable.tags.apply(tags => tencentcloud.getVpcRouteTablesOutput({
    tags: tags,
}));
import pulumi
import pulumi_tencentcloud as tencentcloud
config = pulumi.Config()
availability_zone = config.get("availabilityZone")
if availability_zone is None:
    availability_zone = "ap-guangzhou-3"
foo = tencentcloud.Vpc("foo", cidr_block="10.0.0.0/16")
route_table = tencentcloud.RouteTable("routeTable",
    vpc_id=foo.vpc_id,
    tags={
        "test": "test",
    })
id_instances = tencentcloud.get_vpc_route_tables_output(route_table_id=route_table.route_table_id)
name_instances = tencentcloud.get_vpc_route_tables_output(name=route_table.name)
vpc_default_instance = tencentcloud.get_vpc_route_tables_output(vpc_id=foo.vpc_id,
    association_main=True)
tags_instances = route_table.tags.apply(lambda tags: tencentcloud.get_vpc_route_tables_output(tags=tags))
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
	"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, "")
		availabilityZone := "ap-guangzhou-3"
		if param := cfg.Get("availabilityZone"); param != "" {
			availabilityZone = param
		}
		foo, err := tencentcloud.NewVpc(ctx, "foo", &tencentcloud.VpcArgs{
			CidrBlock: pulumi.String("10.0.0.0/16"),
		})
		if err != nil {
			return err
		}
		routeTable, err := tencentcloud.NewRouteTable(ctx, "routeTable", &tencentcloud.RouteTableArgs{
			VpcId: foo.VpcId,
			Tags: pulumi.StringMap{
				"test": pulumi.String("test"),
			},
		})
		if err != nil {
			return err
		}
		_ = tencentcloud.GetVpcRouteTablesOutput(ctx, tencentcloud.GetVpcRouteTablesOutputArgs{
			RouteTableId: routeTable.RouteTableId,
		}, nil)
		_ = tencentcloud.GetVpcRouteTablesOutput(ctx, tencentcloud.GetVpcRouteTablesOutputArgs{
			Name: routeTable.Name,
		}, nil)
		_ = tencentcloud.GetVpcRouteTablesOutput(ctx, tencentcloud.GetVpcRouteTablesOutputArgs{
			VpcId:           foo.VpcId,
			AssociationMain: pulumi.Bool(true),
		}, nil)
		_ = routeTable.Tags.ApplyT(func(tags map[string]string) (tencentcloud.GetVpcRouteTablesResult, error) {
			return tencentcloud.GetVpcRouteTablesResult(interface{}(tencentcloud.GetVpcRouteTablesOutput(ctx, tencentcloud.GetVpcRouteTablesOutputArgs{
				Tags: tags,
			}, nil))), nil
		}).(tencentcloud.GetVpcRouteTablesResultOutput)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var availabilityZone = config.Get("availabilityZone") ?? "ap-guangzhou-3";
    var foo = new Tencentcloud.Vpc("foo", new()
    {
        CidrBlock = "10.0.0.0/16",
    });
    var routeTable = new Tencentcloud.RouteTable("routeTable", new()
    {
        VpcId = foo.VpcId,
        Tags = 
        {
            { "test", "test" },
        },
    });
    var idInstances = Tencentcloud.GetVpcRouteTables.Invoke(new()
    {
        RouteTableId = routeTable.RouteTableId,
    });
    var nameInstances = Tencentcloud.GetVpcRouteTables.Invoke(new()
    {
        Name = routeTable.Name,
    });
    var vpcDefaultInstance = Tencentcloud.GetVpcRouteTables.Invoke(new()
    {
        VpcId = foo.VpcId,
        AssociationMain = true,
    });
    var tagsInstances = Tencentcloud.GetVpcRouteTables.Invoke(new()
    {
        Tags = routeTable.Tags,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.Vpc;
import com.pulumi.tencentcloud.VpcArgs;
import com.pulumi.tencentcloud.RouteTable;
import com.pulumi.tencentcloud.RouteTableArgs;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetVpcRouteTablesArgs;
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 availabilityZone = config.get("availabilityZone").orElse("ap-guangzhou-3");
        var foo = new Vpc("foo", VpcArgs.builder()
            .cidrBlock("10.0.0.0/16")
            .build());
        var routeTable = new RouteTable("routeTable", RouteTableArgs.builder()
            .vpcId(foo.vpcId())
            .tags(Map.of("test", "test"))
            .build());
        final var idInstances = TencentcloudFunctions.getVpcRouteTables(GetVpcRouteTablesArgs.builder()
            .routeTableId(routeTable.routeTableId())
            .build());
        final var nameInstances = TencentcloudFunctions.getVpcRouteTables(GetVpcRouteTablesArgs.builder()
            .name(routeTable.name())
            .build());
        final var vpcDefaultInstance = TencentcloudFunctions.getVpcRouteTables(GetVpcRouteTablesArgs.builder()
            .vpcId(foo.vpcId())
            .associationMain(true)
            .build());
        final var tagsInstances = TencentcloudFunctions.getVpcRouteTables(GetVpcRouteTablesArgs.builder()
            .tags(routeTable.tags())
            .build());
    }
}
configuration:
  availabilityZone:
    type: string
    default: ap-guangzhou-3
resources:
  foo:
    type: tencentcloud:Vpc
    properties:
      cidrBlock: 10.0.0.0/16
  routeTable:
    type: tencentcloud:RouteTable
    properties:
      vpcId: ${foo.vpcId}
      tags:
        test: test
variables:
  idInstances:
    fn::invoke:
      function: tencentcloud:getVpcRouteTables
      arguments:
        routeTableId: ${routeTable.routeTableId}
  nameInstances:
    fn::invoke:
      function: tencentcloud:getVpcRouteTables
      arguments:
        name: ${routeTable.name}
  vpcDefaultInstance:
    fn::invoke:
      function: tencentcloud:getVpcRouteTables
      arguments:
        vpcId: ${foo.vpcId}
        associationMain: true
  tagsInstances:
    fn::invoke:
      function: tencentcloud:getVpcRouteTables
      arguments:
        tags: ${routeTable.tags}
Using getVpcRouteTables
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 getVpcRouteTables(args: GetVpcRouteTablesArgs, opts?: InvokeOptions): Promise<GetVpcRouteTablesResult>
function getVpcRouteTablesOutput(args: GetVpcRouteTablesOutputArgs, opts?: InvokeOptions): Output<GetVpcRouteTablesResult>def get_vpc_route_tables(association_main: Optional[bool] = None,
                         id: Optional[str] = None,
                         name: Optional[str] = None,
                         result_output_file: Optional[str] = None,
                         route_table_id: Optional[str] = None,
                         tag_key: Optional[str] = None,
                         tags: Optional[Mapping[str, str]] = None,
                         vpc_id: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetVpcRouteTablesResult
def get_vpc_route_tables_output(association_main: Optional[pulumi.Input[bool]] = None,
                         id: Optional[pulumi.Input[str]] = None,
                         name: Optional[pulumi.Input[str]] = None,
                         result_output_file: Optional[pulumi.Input[str]] = None,
                         route_table_id: Optional[pulumi.Input[str]] = None,
                         tag_key: Optional[pulumi.Input[str]] = None,
                         tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                         vpc_id: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetVpcRouteTablesResult]func GetVpcRouteTables(ctx *Context, args *GetVpcRouteTablesArgs, opts ...InvokeOption) (*GetVpcRouteTablesResult, error)
func GetVpcRouteTablesOutput(ctx *Context, args *GetVpcRouteTablesOutputArgs, opts ...InvokeOption) GetVpcRouteTablesResultOutput> Note: This function is named GetVpcRouteTables in the Go SDK.
public static class GetVpcRouteTables 
{
    public static Task<GetVpcRouteTablesResult> InvokeAsync(GetVpcRouteTablesArgs args, InvokeOptions? opts = null)
    public static Output<GetVpcRouteTablesResult> Invoke(GetVpcRouteTablesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVpcRouteTablesResult> getVpcRouteTables(GetVpcRouteTablesArgs args, InvokeOptions options)
public static Output<GetVpcRouteTablesResult> getVpcRouteTables(GetVpcRouteTablesArgs args, InvokeOptions options)
fn::invoke:
  function: tencentcloud:index/getVpcRouteTables:getVpcRouteTables
  arguments:
    # arguments dictionaryThe following arguments are supported:
- AssociationMain bool
- Filter the main routing table.
- Id string
- Name string
- Name of the routing table to be queried.
- ResultOutput stringFile 
- Used to save results.
- RouteTable stringId 
- ID of the routing table to be queried.
- TagKey string
- Filter if routing table has this tag.
- Dictionary<string, string>
- Tags of the routing table to be queried.
- VpcId string
- ID of the VPC to be queried.
- AssociationMain bool
- Filter the main routing table.
- Id string
- Name string
- Name of the routing table to be queried.
- ResultOutput stringFile 
- Used to save results.
- RouteTable stringId 
- ID of the routing table to be queried.
- TagKey string
- Filter if routing table has this tag.
- map[string]string
- Tags of the routing table to be queried.
- VpcId string
- ID of the VPC to be queried.
- associationMain Boolean
- Filter the main routing table.
- id String
- name String
- Name of the routing table to be queried.
- resultOutput StringFile 
- Used to save results.
- routeTable StringId 
- ID of the routing table to be queried.
- tagKey String
- Filter if routing table has this tag.
- Map<String,String>
- Tags of the routing table to be queried.
- vpcId String
- ID of the VPC to be queried.
- associationMain boolean
- Filter the main routing table.
- id string
- name string
- Name of the routing table to be queried.
- resultOutput stringFile 
- Used to save results.
- routeTable stringId 
- ID of the routing table to be queried.
- tagKey string
- Filter if routing table has this tag.
- {[key: string]: string}
- Tags of the routing table to be queried.
- vpcId string
- ID of the VPC to be queried.
- association_main bool
- Filter the main routing table.
- id str
- name str
- Name of the routing table to be queried.
- result_output_ strfile 
- Used to save results.
- route_table_ strid 
- ID of the routing table to be queried.
- tag_key str
- Filter if routing table has this tag.
- Mapping[str, str]
- Tags of the routing table to be queried.
- vpc_id str
- ID of the VPC to be queried.
- associationMain Boolean
- Filter the main routing table.
- id String
- name String
- Name of the routing table to be queried.
- resultOutput StringFile 
- Used to save results.
- routeTable StringId 
- ID of the routing table to be queried.
- tagKey String
- Filter if routing table has this tag.
- Map<String>
- Tags of the routing table to be queried.
- vpcId String
- ID of the VPC to be queried.
getVpcRouteTables Result
The following output properties are available:
- Id string
- InstanceLists List<GetVpc Route Tables Instance List> 
- The information list of the VPC route table.
- AssociationMain bool
- Name string
- Name of the routing table.
- ResultOutput stringFile 
- RouteTable stringId 
- ID of the routing table.
- TagKey string
- Dictionary<string, string>
- Tags of the routing table.
- VpcId string
- ID of the VPC.
- Id string
- InstanceLists []GetVpc Route Tables Instance List 
- The information list of the VPC route table.
- AssociationMain bool
- Name string
- Name of the routing table.
- ResultOutput stringFile 
- RouteTable stringId 
- ID of the routing table.
- TagKey string
- map[string]string
- Tags of the routing table.
- VpcId string
- ID of the VPC.
- id String
- instanceLists List<GetVpc Route Tables Instance List> 
- The information list of the VPC route table.
- associationMain Boolean
- name String
- Name of the routing table.
- resultOutput StringFile 
- routeTable StringId 
- ID of the routing table.
- tagKey String
- Map<String,String>
- Tags of the routing table.
- vpcId String
- ID of the VPC.
- id string
- instanceLists GetVpc Route Tables Instance List[] 
- The information list of the VPC route table.
- associationMain boolean
- name string
- Name of the routing table.
- resultOutput stringFile 
- routeTable stringId 
- ID of the routing table.
- tagKey string
- {[key: string]: string}
- Tags of the routing table.
- vpcId string
- ID of the VPC.
- id str
- instance_lists Sequence[GetVpc Route Tables Instance List] 
- The information list of the VPC route table.
- association_main bool
- name str
- Name of the routing table.
- result_output_ strfile 
- route_table_ strid 
- ID of the routing table.
- tag_key str
- Mapping[str, str]
- Tags of the routing table.
- vpc_id str
- ID of the VPC.
- id String
- instanceLists List<Property Map>
- The information list of the VPC route table.
- associationMain Boolean
- name String
- Name of the routing table.
- resultOutput StringFile 
- routeTable StringId 
- ID of the routing table.
- tagKey String
- Map<String>
- Tags of the routing table.
- vpcId String
- ID of the VPC.
Supporting Types
GetVpcRouteTablesInstanceList     
- CreateTime string
- Creation time of the routing table.
- IsDefault bool
- Indicates whether it is the default routing table.
- Name string
- Name of the routing table to be queried.
- RouteEntry List<GetInfos Vpc Route Tables Instance List Route Entry Info> 
- Detailed information of each entry of the route table.
- RouteTable stringId 
- ID of the routing table to be queried.
- SubnetIds List<string>
- List of subnet IDs bound to the route table.
- Dictionary<string, string>
- Tags of the routing table to be queried.
- VpcId string
- ID of the VPC to be queried.
- CreateTime string
- Creation time of the routing table.
- IsDefault bool
- Indicates whether it is the default routing table.
- Name string
- Name of the routing table to be queried.
- RouteEntry []GetInfos Vpc Route Tables Instance List Route Entry Info 
- Detailed information of each entry of the route table.
- RouteTable stringId 
- ID of the routing table to be queried.
- SubnetIds []string
- List of subnet IDs bound to the route table.
- map[string]string
- Tags of the routing table to be queried.
- VpcId string
- ID of the VPC to be queried.
- createTime String
- Creation time of the routing table.
- isDefault Boolean
- Indicates whether it is the default routing table.
- name String
- Name of the routing table to be queried.
- routeEntry List<GetInfos Vpc Route Tables Instance List Route Entry Info> 
- Detailed information of each entry of the route table.
- routeTable StringId 
- ID of the routing table to be queried.
- subnetIds List<String>
- List of subnet IDs bound to the route table.
- Map<String,String>
- Tags of the routing table to be queried.
- vpcId String
- ID of the VPC to be queried.
- createTime string
- Creation time of the routing table.
- isDefault boolean
- Indicates whether it is the default routing table.
- name string
- Name of the routing table to be queried.
- routeEntry GetInfos Vpc Route Tables Instance List Route Entry Info[] 
- Detailed information of each entry of the route table.
- routeTable stringId 
- ID of the routing table to be queried.
- subnetIds string[]
- List of subnet IDs bound to the route table.
- {[key: string]: string}
- Tags of the routing table to be queried.
- vpcId string
- ID of the VPC to be queried.
- create_time str
- Creation time of the routing table.
- is_default bool
- Indicates whether it is the default routing table.
- name str
- Name of the routing table to be queried.
- route_entry_ Sequence[Getinfos Vpc Route Tables Instance List Route Entry Info] 
- Detailed information of each entry of the route table.
- route_table_ strid 
- ID of the routing table to be queried.
- subnet_ids Sequence[str]
- List of subnet IDs bound to the route table.
- Mapping[str, str]
- Tags of the routing table to be queried.
- vpc_id str
- ID of the VPC to be queried.
- createTime String
- Creation time of the routing table.
- isDefault Boolean
- Indicates whether it is the default routing table.
- name String
- Name of the routing table to be queried.
- routeEntry List<Property Map>Infos 
- Detailed information of each entry of the route table.
- routeTable StringId 
- ID of the routing table to be queried.
- subnetIds List<String>
- List of subnet IDs bound to the route table.
- Map<String>
- Tags of the routing table to be queried.
- vpcId String
- ID of the VPC to be queried.
GetVpcRouteTablesInstanceListRouteEntryInfo        
- Description string
- Description information user defined for a route table rule.
- DestinationCidr stringBlock 
- The destination address block.
- NextHub string
- ID of next-hop gateway. Note: when 'next_type' is EIP, GatewayId will fix the value 0.
- NextType string
- Type of next-hop, and available values include CVM,VPN,DIRECTCONNECT,PEERCONNECTION,SSLVPN,NAT,NORMAL_CVM,EIPandCCN.
- RouteEntry stringId 
- ID of a route table entry.
- Description string
- Description information user defined for a route table rule.
- DestinationCidr stringBlock 
- The destination address block.
- NextHub string
- ID of next-hop gateway. Note: when 'next_type' is EIP, GatewayId will fix the value 0.
- NextType string
- Type of next-hop, and available values include CVM,VPN,DIRECTCONNECT,PEERCONNECTION,SSLVPN,NAT,NORMAL_CVM,EIPandCCN.
- RouteEntry stringId 
- ID of a route table entry.
- description String
- Description information user defined for a route table rule.
- destinationCidr StringBlock 
- The destination address block.
- nextHub String
- ID of next-hop gateway. Note: when 'next_type' is EIP, GatewayId will fix the value 0.
- nextType String
- Type of next-hop, and available values include CVM,VPN,DIRECTCONNECT,PEERCONNECTION,SSLVPN,NAT,NORMAL_CVM,EIPandCCN.
- routeEntry StringId 
- ID of a route table entry.
- description string
- Description information user defined for a route table rule.
- destinationCidr stringBlock 
- The destination address block.
- nextHub string
- ID of next-hop gateway. Note: when 'next_type' is EIP, GatewayId will fix the value 0.
- nextType string
- Type of next-hop, and available values include CVM,VPN,DIRECTCONNECT,PEERCONNECTION,SSLVPN,NAT,NORMAL_CVM,EIPandCCN.
- routeEntry stringId 
- ID of a route table entry.
- description str
- Description information user defined for a route table rule.
- destination_cidr_ strblock 
- The destination address block.
- next_hub str
- ID of next-hop gateway. Note: when 'next_type' is EIP, GatewayId will fix the value 0.
- next_type str
- Type of next-hop, and available values include CVM,VPN,DIRECTCONNECT,PEERCONNECTION,SSLVPN,NAT,NORMAL_CVM,EIPandCCN.
- route_entry_ strid 
- ID of a route table entry.
- description String
- Description information user defined for a route table rule.
- destinationCidr StringBlock 
- The destination address block.
- nextHub String
- ID of next-hop gateway. Note: when 'next_type' is EIP, GatewayId will fix the value 0.
- nextType String
- Type of next-hop, and available values include CVM,VPN,DIRECTCONNECT,PEERCONNECTION,SSLVPN,NAT,NORMAL_CVM,EIPandCCN.
- routeEntry StringId 
- ID of a route table entry.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the tencentcloudTerraform Provider.
tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack