tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack
tencentcloud.getVpcRouteTables
Explore with Pulumi AI
tencentcloud 1.81.189 published on Wednesday, Apr 30, 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 dictionary
The following arguments are supported:
- Association
Main bool - Filter the main routing table.
- Id string
- Name string
- Name of the routing table to be queried.
- Result
Output stringFile - Used to save results.
- Route
Table stringId - ID of the routing table to be queried.
- Tag
Key string - Filter if routing table has this tag.
- Dictionary<string, string>
- Tags of the routing table to be queried.
- Vpc
Id string - ID of the VPC to be queried.
- Association
Main bool - Filter the main routing table.
- Id string
- Name string
- Name of the routing table to be queried.
- Result
Output stringFile - Used to save results.
- Route
Table stringId - ID of the routing table to be queried.
- Tag
Key string - Filter if routing table has this tag.
- map[string]string
- Tags of the routing table to be queried.
- Vpc
Id string - ID of the VPC to be queried.
- association
Main Boolean - Filter the main routing table.
- id String
- name String
- Name of the routing table to be queried.
- result
Output StringFile - Used to save results.
- route
Table StringId - ID of the routing table to be queried.
- tag
Key String - Filter if routing table has this tag.
- Map<String,String>
- Tags of the routing table to be queried.
- vpc
Id String - ID of the VPC to be queried.
- association
Main boolean - Filter the main routing table.
- id string
- name string
- Name of the routing table to be queried.
- result
Output stringFile - Used to save results.
- route
Table stringId - ID of the routing table to be queried.
- tag
Key string - Filter if routing table has this tag.
- {[key: string]: string}
- Tags of the routing table to be queried.
- vpc
Id 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.
- association
Main Boolean - Filter the main routing table.
- id String
- name String
- Name of the routing table to be queried.
- result
Output StringFile - Used to save results.
- route
Table StringId - ID of the routing table to be queried.
- tag
Key String - Filter if routing table has this tag.
- Map<String>
- Tags of the routing table to be queried.
- vpc
Id String - ID of the VPC to be queried.
getVpcRouteTables Result
The following output properties are available:
- Id string
- Instance
Lists List<GetVpc Route Tables Instance List> - The information list of the VPC route table.
- Association
Main bool - Name string
- Name of the routing table.
- Result
Output stringFile - Route
Table stringId - ID of the routing table.
- Tag
Key string - Dictionary<string, string>
- Tags of the routing table.
- Vpc
Id string - ID of the VPC.
- Id string
- Instance
Lists []GetVpc Route Tables Instance List - The information list of the VPC route table.
- Association
Main bool - Name string
- Name of the routing table.
- Result
Output stringFile - Route
Table stringId - ID of the routing table.
- Tag
Key string - map[string]string
- Tags of the routing table.
- Vpc
Id string - ID of the VPC.
- id String
- instance
Lists List<GetVpc Route Tables Instance List> - The information list of the VPC route table.
- association
Main Boolean - name String
- Name of the routing table.
- result
Output StringFile - route
Table StringId - ID of the routing table.
- tag
Key String - Map<String,String>
- Tags of the routing table.
- vpc
Id String - ID of the VPC.
- id string
- instance
Lists GetVpc Route Tables Instance List[] - The information list of the VPC route table.
- association
Main boolean - name string
- Name of the routing table.
- result
Output stringFile - route
Table stringId - ID of the routing table.
- tag
Key string - {[key: string]: string}
- Tags of the routing table.
- vpc
Id 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
- instance
Lists List<Property Map> - The information list of the VPC route table.
- association
Main Boolean - name String
- Name of the routing table.
- result
Output StringFile - route
Table StringId - ID of the routing table.
- tag
Key String - Map<String>
- Tags of the routing table.
- vpc
Id String - ID of the VPC.
Supporting Types
GetVpcRouteTablesInstanceList
- Create
Time string - Creation time of the routing table.
- Is
Default bool - Indicates whether it is the default routing table.
- Name string
- Name of the routing table to be queried.
- Route
Entry List<GetInfos Vpc Route Tables Instance List Route Entry Info> - Detailed information of each entry of the route table.
- Route
Table stringId - ID of the routing table to be queried.
- Subnet
Ids List<string> - List of subnet IDs bound to the route table.
- Dictionary<string, string>
- Tags of the routing table to be queried.
- Vpc
Id string - ID of the VPC to be queried.
- Create
Time string - Creation time of the routing table.
- Is
Default bool - Indicates whether it is the default routing table.
- Name string
- Name of the routing table to be queried.
- Route
Entry []GetInfos Vpc Route Tables Instance List Route Entry Info - Detailed information of each entry of the route table.
- Route
Table stringId - ID of the routing table to be queried.
- Subnet
Ids []string - List of subnet IDs bound to the route table.
- map[string]string
- Tags of the routing table to be queried.
- Vpc
Id string - ID of the VPC to be queried.
- create
Time String - Creation time of the routing table.
- is
Default Boolean - Indicates whether it is the default routing table.
- name String
- Name of the routing table to be queried.
- route
Entry List<GetInfos Vpc Route Tables Instance List Route Entry Info> - Detailed information of each entry of the route table.
- route
Table StringId - ID of the routing table to be queried.
- subnet
Ids List<String> - List of subnet IDs bound to the route table.
- Map<String,String>
- Tags of the routing table to be queried.
- vpc
Id String - ID of the VPC to be queried.
- create
Time string - Creation time of the routing table.
- is
Default boolean - Indicates whether it is the default routing table.
- name string
- Name of the routing table to be queried.
- route
Entry GetInfos Vpc Route Tables Instance List Route Entry Info[] - Detailed information of each entry of the route table.
- route
Table stringId - ID of the routing table to be queried.
- subnet
Ids string[] - List of subnet IDs bound to the route table.
- {[key: string]: string}
- Tags of the routing table to be queried.
- vpc
Id 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.
- create
Time String - Creation time of the routing table.
- is
Default Boolean - Indicates whether it is the default routing table.
- name String
- Name of the routing table to be queried.
- route
Entry List<Property Map>Infos - Detailed information of each entry of the route table.
- route
Table StringId - ID of the routing table to be queried.
- subnet
Ids List<String> - List of subnet IDs bound to the route table.
- Map<String>
- Tags of the routing table to be queried.
- vpc
Id String - ID of the VPC to be queried.
GetVpcRouteTablesInstanceListRouteEntryInfo
- Description string
- Description information user defined for a route table rule.
- Destination
Cidr stringBlock - The destination address block.
- Next
Hub string - ID of next-hop gateway. Note: when 'next_type' is EIP, GatewayId will fix the value
0
. - Next
Type string - Type of next-hop, and available values include
CVM
,VPN
,DIRECTCONNECT
,PEERCONNECTION
,SSLVPN
,NAT
,NORMAL_CVM
,EIP
andCCN
. - Route
Entry stringId - ID of a route table entry.
- Description string
- Description information user defined for a route table rule.
- Destination
Cidr stringBlock - The destination address block.
- Next
Hub string - ID of next-hop gateway. Note: when 'next_type' is EIP, GatewayId will fix the value
0
. - Next
Type string - Type of next-hop, and available values include
CVM
,VPN
,DIRECTCONNECT
,PEERCONNECTION
,SSLVPN
,NAT
,NORMAL_CVM
,EIP
andCCN
. - Route
Entry stringId - ID of a route table entry.
- description String
- Description information user defined for a route table rule.
- destination
Cidr StringBlock - The destination address block.
- next
Hub String - ID of next-hop gateway. Note: when 'next_type' is EIP, GatewayId will fix the value
0
. - next
Type String - Type of next-hop, and available values include
CVM
,VPN
,DIRECTCONNECT
,PEERCONNECTION
,SSLVPN
,NAT
,NORMAL_CVM
,EIP
andCCN
. - route
Entry StringId - ID of a route table entry.
- description string
- Description information user defined for a route table rule.
- destination
Cidr stringBlock - The destination address block.
- next
Hub string - ID of next-hop gateway. Note: when 'next_type' is EIP, GatewayId will fix the value
0
. - next
Type string - Type of next-hop, and available values include
CVM
,VPN
,DIRECTCONNECT
,PEERCONNECTION
,SSLVPN
,NAT
,NORMAL_CVM
,EIP
andCCN
. - route
Entry 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
,EIP
andCCN
. - route_
entry_ strid - ID of a route table entry.
- description String
- Description information user defined for a route table rule.
- destination
Cidr StringBlock - The destination address block.
- next
Hub String - ID of next-hop gateway. Note: when 'next_type' is EIP, GatewayId will fix the value
0
. - next
Type String - Type of next-hop, and available values include
CVM
,VPN
,DIRECTCONNECT
,PEERCONNECTION
,SSLVPN
,NAT
,NORMAL_CVM
,EIP
andCCN
. - route
Entry StringId - ID of a route table entry.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack