1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. RouteTable
tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack

tencentcloud.RouteTable

Explore with Pulumi AI

Provides a resource to create a VPC routing table.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const fooVpc = new tencentcloud.Vpc("fooVpc", {cidrBlock: "10.0.0.0/16"});
const fooRouteTable = new tencentcloud.RouteTable("fooRouteTable", {vpcId: fooVpc.vpcId});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

foo_vpc = tencentcloud.Vpc("fooVpc", cidr_block="10.0.0.0/16")
foo_route_table = tencentcloud.RouteTable("fooRouteTable", vpc_id=foo_vpc.vpc_id)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		fooVpc, err := tencentcloud.NewVpc(ctx, "fooVpc", &tencentcloud.VpcArgs{
			CidrBlock: pulumi.String("10.0.0.0/16"),
		})
		if err != nil {
			return err
		}
		_, err = tencentcloud.NewRouteTable(ctx, "fooRouteTable", &tencentcloud.RouteTableArgs{
			VpcId: fooVpc.VpcId,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var fooVpc = new Tencentcloud.Vpc("fooVpc", new()
    {
        CidrBlock = "10.0.0.0/16",
    });

    var fooRouteTable = new Tencentcloud.RouteTable("fooRouteTable", new()
    {
        VpcId = fooVpc.VpcId,
    });

});
Copy
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 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) {
        var fooVpc = new Vpc("fooVpc", VpcArgs.builder()
            .cidrBlock("10.0.0.0/16")
            .build());

        var fooRouteTable = new RouteTable("fooRouteTable", RouteTableArgs.builder()
            .vpcId(fooVpc.vpcId())
            .build());

    }
}
Copy
resources:
  fooVpc:
    type: tencentcloud:Vpc
    properties:
      cidrBlock: 10.0.0.0/16
  fooRouteTable:
    type: tencentcloud:RouteTable
    properties:
      vpcId: ${fooVpc.vpcId}
Copy

Create RouteTable Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new RouteTable(name: string, args: RouteTableArgs, opts?: CustomResourceOptions);
@overload
def RouteTable(resource_name: str,
               args: RouteTableArgs,
               opts: Optional[ResourceOptions] = None)

@overload
def RouteTable(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               vpc_id: Optional[str] = None,
               name: Optional[str] = None,
               route_table_id: Optional[str] = None,
               tags: Optional[Mapping[str, str]] = None)
func NewRouteTable(ctx *Context, name string, args RouteTableArgs, opts ...ResourceOption) (*RouteTable, error)
public RouteTable(string name, RouteTableArgs args, CustomResourceOptions? opts = null)
public RouteTable(String name, RouteTableArgs args)
public RouteTable(String name, RouteTableArgs args, CustomResourceOptions options)
type: tencentcloud:RouteTable
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RouteTableArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RouteTableArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RouteTableArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RouteTableArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RouteTableArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

RouteTable Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The RouteTable resource accepts the following input properties:

VpcId This property is required. string
ID of VPC to which the route table should be associated.
Name string
The name of routing table.
RouteTableId string
ID of the resource.
Tags Dictionary<string, string>
The tags of routing table.
VpcId This property is required. string
ID of VPC to which the route table should be associated.
Name string
The name of routing table.
RouteTableId string
ID of the resource.
Tags map[string]string
The tags of routing table.
vpcId This property is required. String
ID of VPC to which the route table should be associated.
name String
The name of routing table.
routeTableId String
ID of the resource.
tags Map<String,String>
The tags of routing table.
vpcId This property is required. string
ID of VPC to which the route table should be associated.
name string
The name of routing table.
routeTableId string
ID of the resource.
tags {[key: string]: string}
The tags of routing table.
vpc_id This property is required. str
ID of VPC to which the route table should be associated.
name str
The name of routing table.
route_table_id str
ID of the resource.
tags Mapping[str, str]
The tags of routing table.
vpcId This property is required. String
ID of VPC to which the route table should be associated.
name String
The name of routing table.
routeTableId String
ID of the resource.
tags Map<String>
The tags of routing table.

Outputs

All input properties are implicitly available as output properties. Additionally, the RouteTable resource produces the following output properties:

CreateTime string
Creation time of the routing table.
Id string
The provider-assigned unique ID for this managed resource.
IsDefault bool
Indicates whether it is the default routing table.
RouteEntryIds List<string>
ID list of the routing entries.
SubnetIds List<string>
ID list of the subnets associated with this route table.
CreateTime string
Creation time of the routing table.
Id string
The provider-assigned unique ID for this managed resource.
IsDefault bool
Indicates whether it is the default routing table.
RouteEntryIds []string
ID list of the routing entries.
SubnetIds []string
ID list of the subnets associated with this route table.
createTime String
Creation time of the routing table.
id String
The provider-assigned unique ID for this managed resource.
isDefault Boolean
Indicates whether it is the default routing table.
routeEntryIds List<String>
ID list of the routing entries.
subnetIds List<String>
ID list of the subnets associated with this route table.
createTime string
Creation time of the routing table.
id string
The provider-assigned unique ID for this managed resource.
isDefault boolean
Indicates whether it is the default routing table.
routeEntryIds string[]
ID list of the routing entries.
subnetIds string[]
ID list of the subnets associated with this route table.
create_time str
Creation time of the routing table.
id str
The provider-assigned unique ID for this managed resource.
is_default bool
Indicates whether it is the default routing table.
route_entry_ids Sequence[str]
ID list of the routing entries.
subnet_ids Sequence[str]
ID list of the subnets associated with this route table.
createTime String
Creation time of the routing table.
id String
The provider-assigned unique ID for this managed resource.
isDefault Boolean
Indicates whether it is the default routing table.
routeEntryIds List<String>
ID list of the routing entries.
subnetIds List<String>
ID list of the subnets associated with this route table.

Look up Existing RouteTable Resource

Get an existing RouteTable resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: RouteTableState, opts?: CustomResourceOptions): RouteTable
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        create_time: Optional[str] = None,
        is_default: Optional[bool] = None,
        name: Optional[str] = None,
        route_entry_ids: Optional[Sequence[str]] = None,
        route_table_id: Optional[str] = None,
        subnet_ids: Optional[Sequence[str]] = None,
        tags: Optional[Mapping[str, str]] = None,
        vpc_id: Optional[str] = None) -> RouteTable
func GetRouteTable(ctx *Context, name string, id IDInput, state *RouteTableState, opts ...ResourceOption) (*RouteTable, error)
public static RouteTable Get(string name, Input<string> id, RouteTableState? state, CustomResourceOptions? opts = null)
public static RouteTable get(String name, Output<String> id, RouteTableState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:RouteTable    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CreateTime string
Creation time of the routing table.
IsDefault bool
Indicates whether it is the default routing table.
Name string
The name of routing table.
RouteEntryIds List<string>
ID list of the routing entries.
RouteTableId string
ID of the resource.
SubnetIds List<string>
ID list of the subnets associated with this route table.
Tags Dictionary<string, string>
The tags of routing table.
VpcId string
ID of VPC to which the route table should be associated.
CreateTime string
Creation time of the routing table.
IsDefault bool
Indicates whether it is the default routing table.
Name string
The name of routing table.
RouteEntryIds []string
ID list of the routing entries.
RouteTableId string
ID of the resource.
SubnetIds []string
ID list of the subnets associated with this route table.
Tags map[string]string
The tags of routing table.
VpcId string
ID of VPC to which the route table should be associated.
createTime String
Creation time of the routing table.
isDefault Boolean
Indicates whether it is the default routing table.
name String
The name of routing table.
routeEntryIds List<String>
ID list of the routing entries.
routeTableId String
ID of the resource.
subnetIds List<String>
ID list of the subnets associated with this route table.
tags Map<String,String>
The tags of routing table.
vpcId String
ID of VPC to which the route table should be associated.
createTime string
Creation time of the routing table.
isDefault boolean
Indicates whether it is the default routing table.
name string
The name of routing table.
routeEntryIds string[]
ID list of the routing entries.
routeTableId string
ID of the resource.
subnetIds string[]
ID list of the subnets associated with this route table.
tags {[key: string]: string}
The tags of routing table.
vpcId string
ID of VPC to which the route table should be associated.
create_time str
Creation time of the routing table.
is_default bool
Indicates whether it is the default routing table.
name str
The name of routing table.
route_entry_ids Sequence[str]
ID list of the routing entries.
route_table_id str
ID of the resource.
subnet_ids Sequence[str]
ID list of the subnets associated with this route table.
tags Mapping[str, str]
The tags of routing table.
vpc_id str
ID of VPC to which the route table should be associated.
createTime String
Creation time of the routing table.
isDefault Boolean
Indicates whether it is the default routing table.
name String
The name of routing table.
routeEntryIds List<String>
ID list of the routing entries.
routeTableId String
ID of the resource.
subnetIds List<String>
ID list of the subnets associated with this route table.
tags Map<String>
The tags of routing table.
vpcId String
ID of VPC to which the route table should be associated.

Import

Vpc routetable instance can be imported, e.g.

$ pulumi import tencentcloud:index/routeTable:RouteTable test route_table_id
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
tencentcloud tencentcloudstack/terraform-provider-tencentcloud
License
Notes
This Pulumi package is based on the tencentcloud Terraform Provider.