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

tencentcloud.RouteTable

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    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});
    
    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)
    
    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
    	})
    }
    
    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,
        });
    
    });
    
    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());
    
        }
    }
    
    resources:
      fooVpc:
        type: tencentcloud:Vpc
        properties:
          cidrBlock: 10.0.0.0/16
      fooRouteTable:
        type: tencentcloud:RouteTable
        properties:
          vpcId: ${fooVpc.vpcId}
    

    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 string
    The unique name of the resource.
    args RouteTableArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args 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 string
    The unique name of the resource.
    args RouteTableArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RouteTableArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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 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 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 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 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 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 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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    

    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.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack