1. Registry
  2. Packages
  3. Ucloud Provider
  4. API Docs
  5. RouteTable
Viewing docs for ucloud 1.45.0
published on Thursday, Sep 24, 2026 by ucloud
Viewing docs for ucloud 1.45.0
published on Thursday, Sep 24, 2026 by ucloud

    Provides a Route Table resource under a VPC.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ucloud from "@pulumi/ucloud";
    
    const foo = new ucloud.Vpc("foo", {
        name: "tf-example-vpc",
        tag: "tf-example",
        cidrBlocks: ["192.168.0.0/16"],
    });
    const fooRouteTable = new ucloud.RouteTable("foo", {
        name: "tf-example-route-table",
        tag: "tf-example",
        remark: "tf-example-route-table",
        vpcId: foo.vpcId,
    });
    
    import pulumi
    import pulumi_ucloud as ucloud
    
    foo = ucloud.Vpc("foo",
        name="tf-example-vpc",
        tag="tf-example",
        cidr_blocks=["192.168.0.0/16"])
    foo_route_table = ucloud.RouteTable("foo",
        name="tf-example-route-table",
        tag="tf-example",
        remark="tf-example-route-table",
        vpc_id=foo.vpc_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		foo, err := ucloud.NewVpc(ctx, "foo", &ucloud.VpcArgs{
    			Name: pulumi.String("tf-example-vpc"),
    			Tag:  pulumi.String("tf-example"),
    			CidrBlocks: pulumi.StringArray{
    				pulumi.String("192.168.0.0/16"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ucloud.NewRouteTable(ctx, "foo", &ucloud.RouteTableArgs{
    			Name:   pulumi.String("tf-example-route-table"),
    			Tag:    pulumi.String("tf-example"),
    			Remark: pulumi.String("tf-example-route-table"),
    			VpcId:  foo.VpcId,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ucloud = Pulumi.Ucloud;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = new Ucloud.Vpc("foo", new()
        {
            Name = "tf-example-vpc",
            Tag = "tf-example",
            CidrBlocks = new[]
            {
                "192.168.0.0/16",
            },
        });
    
        var fooRouteTable = new Ucloud.RouteTable("foo", new()
        {
            Name = "tf-example-route-table",
            Tag = "tf-example",
            Remark = "tf-example-route-table",
            VpcId = foo.VpcId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ucloud.Vpc;
    import com.pulumi.ucloud.VpcArgs;
    import com.pulumi.ucloud.RouteTable;
    import com.pulumi.ucloud.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 foo = new Vpc("foo", VpcArgs.builder()
                .name("tf-example-vpc")
                .tag("tf-example")
                .cidrBlocks("192.168.0.0/16")
                .build());
    
            var fooRouteTable = new RouteTable("fooRouteTable", RouteTableArgs.builder()
                .name("tf-example-route-table")
                .tag("tf-example")
                .remark("tf-example-route-table")
                .vpcId(foo.vpcId())
                .build());
    
        }
    }
    
    resources:
      foo:
        type: ucloud:Vpc
        properties:
          name: tf-example-vpc
          tag: tf-example
          cidrBlocks:
            - 192.168.0.0/16
      fooRouteTable:
        type: ucloud:RouteTable
        name: foo
        properties:
          name: tf-example-route-table
          tag: tf-example
          remark: tf-example-route-table
          vpcId: ${foo.vpcId}
    
    Example coming soon!
    

    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,
                   remark: Optional[str] = None,
                   route_table_id: Optional[str] = None,
                   tag: Optional[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: ucloud:RouteTable
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "ucloud_route_table" "name" {
        # resource properties
    }

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var routeTableResource = new Ucloud.RouteTable("routeTableResource", new()
    {
        VpcId = "string",
        Name = "string",
        Remark = "string",
        RouteTableId = "string",
        Tag = "string",
    });
    
    example, err := ucloud.NewRouteTable(ctx, "routeTableResource", &ucloud.RouteTableArgs{
    	VpcId:        pulumi.String("string"),
    	Name:         pulumi.String("string"),
    	Remark:       pulumi.String("string"),
    	RouteTableId: pulumi.String("string"),
    	Tag:          pulumi.String("string"),
    })
    
    resource "ucloud_route_table" "routeTableResource" {
      lifecycle {
        create_before_destroy = true
      }
      vpc_id         = "string"
      name           = "string"
      remark         = "string"
      route_table_id = "string"
      tag            = "string"
    }
    
    var routeTableResource = new RouteTable("routeTableResource", RouteTableArgs.builder()
        .vpcId("string")
        .name("string")
        .remark("string")
        .routeTableId("string")
        .tag("string")
        .build());
    
    route_table_resource = ucloud.RouteTable("routeTableResource",
        vpc_id="string",
        name="string",
        remark="string",
        route_table_id="string",
        tag="string")
    
    const routeTableResource = new ucloud.RouteTable("routeTableResource", {
        vpcId: "string",
        name: "string",
        remark: "string",
        routeTableId: "string",
        tag: "string",
    });
    
    type: ucloud:RouteTable
    properties:
        name: string
        remark: string
        routeTableId: string
        tag: string
        vpcId: string
    

    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
    The ID of the VPC that the route table belongs to.


    Name string
    Remark string
    The remarks of the route table. (Default: "").
    RouteTableId string
    The ID of the route table.
    Tag string
    A tag assigned to the route table, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or an empty string is filled in, then the default tag will be assigned. (Default: Default).
    VpcId string
    The ID of the VPC that the route table belongs to.


    Name string
    Remark string
    The remarks of the route table. (Default: "").
    RouteTableId string
    The ID of the route table.
    Tag string
    A tag assigned to the route table, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or an empty string is filled in, then the default tag will be assigned. (Default: Default).
    vpc_id string
    The ID of the VPC that the route table belongs to.


    name string
    remark string
    The remarks of the route table. (Default: "").
    route_table_id string
    The ID of the route table.
    tag string
    A tag assigned to the route table, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or an empty string is filled in, then the default tag will be assigned. (Default: Default).
    vpcId String
    The ID of the VPC that the route table belongs to.


    name String
    remark String
    The remarks of the route table. (Default: "").
    routeTableId String
    The ID of the route table.
    tag String
    A tag assigned to the route table, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or an empty string is filled in, then the default tag will be assigned. (Default: Default).
    vpcId string
    The ID of the VPC that the route table belongs to.


    name string
    remark string
    The remarks of the route table. (Default: "").
    routeTableId string
    The ID of the route table.
    tag string
    A tag assigned to the route table, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or an empty string is filled in, then the default tag will be assigned. (Default: Default).
    vpc_id str
    The ID of the VPC that the route table belongs to.


    name str
    remark str
    The remarks of the route table. (Default: "").
    route_table_id str
    The ID of the route table.
    tag str
    A tag assigned to the route table, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or an empty string is filled in, then the default tag will be assigned. (Default: Default).
    vpcId String
    The ID of the VPC that the route table belongs to.


    name String
    remark String
    The remarks of the route table. (Default: "").
    routeTableId String
    The ID of the route table.
    tag String
    A tag assigned to the route table, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or an empty string is filled in, then the default tag will be assigned. (Default: Default).

    Outputs

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

    CreateTime string
    The time of creation of the route table, formatted in RFC3339 time string.
    Id string
    The provider-assigned unique ID for this managed resource.
    RouteTableType double
    The type of the route table. 1 is the default route table, 0 is a custom route table.
    SubnetCount double
    The number of subnets bound to the route table.
    SubnetIds List<string>
    The list of subnet IDs bound to the route table.
    VpcName string
    The name of the VPC that the route table belongs to.
    CreateTime string
    The time of creation of the route table, formatted in RFC3339 time string.
    Id string
    The provider-assigned unique ID for this managed resource.
    RouteTableType float64
    The type of the route table. 1 is the default route table, 0 is a custom route table.
    SubnetCount float64
    The number of subnets bound to the route table.
    SubnetIds []string
    The list of subnet IDs bound to the route table.
    VpcName string
    The name of the VPC that the route table belongs to.
    create_time string
    The time of creation of the route table, formatted in RFC3339 time string.
    id string
    The provider-assigned unique ID for this managed resource.
    route_table_type number
    The type of the route table. 1 is the default route table, 0 is a custom route table.
    subnet_count number
    The number of subnets bound to the route table.
    subnet_ids list(string)
    The list of subnet IDs bound to the route table.
    vpc_name string
    The name of the VPC that the route table belongs to.
    createTime String
    The time of creation of the route table, formatted in RFC3339 time string.
    id String
    The provider-assigned unique ID for this managed resource.
    routeTableType Double
    The type of the route table. 1 is the default route table, 0 is a custom route table.
    subnetCount Double
    The number of subnets bound to the route table.
    subnetIds List<String>
    The list of subnet IDs bound to the route table.
    vpcName String
    The name of the VPC that the route table belongs to.
    createTime string
    The time of creation of the route table, formatted in RFC3339 time string.
    id string
    The provider-assigned unique ID for this managed resource.
    routeTableType number
    The type of the route table. 1 is the default route table, 0 is a custom route table.
    subnetCount number
    The number of subnets bound to the route table.
    subnetIds string[]
    The list of subnet IDs bound to the route table.
    vpcName string
    The name of the VPC that the route table belongs to.
    create_time str
    The time of creation of the route table, formatted in RFC3339 time string.
    id str
    The provider-assigned unique ID for this managed resource.
    route_table_type float
    The type of the route table. 1 is the default route table, 0 is a custom route table.
    subnet_count float
    The number of subnets bound to the route table.
    subnet_ids Sequence[str]
    The list of subnet IDs bound to the route table.
    vpc_name str
    The name of the VPC that the route table belongs to.
    createTime String
    The time of creation of the route table, formatted in RFC3339 time string.
    id String
    The provider-assigned unique ID for this managed resource.
    routeTableType Number
    The type of the route table. 1 is the default route table, 0 is a custom route table.
    subnetCount Number
    The number of subnets bound to the route table.
    subnetIds List<String>
    The list of subnet IDs bound to the route table.
    vpcName String
    The name of the VPC that the route table belongs to.

    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,
            name: Optional[str] = None,
            remark: Optional[str] = None,
            route_table_id: Optional[str] = None,
            route_table_type: Optional[float] = None,
            subnet_count: Optional[float] = None,
            subnet_ids: Optional[Sequence[str]] = None,
            tag: Optional[str] = None,
            vpc_id: Optional[str] = None,
            vpc_name: 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: ucloud:RouteTable    get:      id: ${id}
    import {
      to = ucloud_route_table.example
      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
    The time of creation of the route table, formatted in RFC3339 time string.
    Name string
    Remark string
    The remarks of the route table. (Default: "").
    RouteTableId string
    The ID of the route table.
    RouteTableType double
    The type of the route table. 1 is the default route table, 0 is a custom route table.
    SubnetCount double
    The number of subnets bound to the route table.
    SubnetIds List<string>
    The list of subnet IDs bound to the route table.
    Tag string
    A tag assigned to the route table, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or an empty string is filled in, then the default tag will be assigned. (Default: Default).
    VpcId string
    The ID of the VPC that the route table belongs to.


    VpcName string
    The name of the VPC that the route table belongs to.
    CreateTime string
    The time of creation of the route table, formatted in RFC3339 time string.
    Name string
    Remark string
    The remarks of the route table. (Default: "").
    RouteTableId string
    The ID of the route table.
    RouteTableType float64
    The type of the route table. 1 is the default route table, 0 is a custom route table.
    SubnetCount float64
    The number of subnets bound to the route table.
    SubnetIds []string
    The list of subnet IDs bound to the route table.
    Tag string
    A tag assigned to the route table, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or an empty string is filled in, then the default tag will be assigned. (Default: Default).
    VpcId string
    The ID of the VPC that the route table belongs to.


    VpcName string
    The name of the VPC that the route table belongs to.
    create_time string
    The time of creation of the route table, formatted in RFC3339 time string.
    name string
    remark string
    The remarks of the route table. (Default: "").
    route_table_id string
    The ID of the route table.
    route_table_type number
    The type of the route table. 1 is the default route table, 0 is a custom route table.
    subnet_count number
    The number of subnets bound to the route table.
    subnet_ids list(string)
    The list of subnet IDs bound to the route table.
    tag string
    A tag assigned to the route table, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or an empty string is filled in, then the default tag will be assigned. (Default: Default).
    vpc_id string
    The ID of the VPC that the route table belongs to.


    vpc_name string
    The name of the VPC that the route table belongs to.
    createTime String
    The time of creation of the route table, formatted in RFC3339 time string.
    name String
    remark String
    The remarks of the route table. (Default: "").
    routeTableId String
    The ID of the route table.
    routeTableType Double
    The type of the route table. 1 is the default route table, 0 is a custom route table.
    subnetCount Double
    The number of subnets bound to the route table.
    subnetIds List<String>
    The list of subnet IDs bound to the route table.
    tag String
    A tag assigned to the route table, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or an empty string is filled in, then the default tag will be assigned. (Default: Default).
    vpcId String
    The ID of the VPC that the route table belongs to.


    vpcName String
    The name of the VPC that the route table belongs to.
    createTime string
    The time of creation of the route table, formatted in RFC3339 time string.
    name string
    remark string
    The remarks of the route table. (Default: "").
    routeTableId string
    The ID of the route table.
    routeTableType number
    The type of the route table. 1 is the default route table, 0 is a custom route table.
    subnetCount number
    The number of subnets bound to the route table.
    subnetIds string[]
    The list of subnet IDs bound to the route table.
    tag string
    A tag assigned to the route table, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or an empty string is filled in, then the default tag will be assigned. (Default: Default).
    vpcId string
    The ID of the VPC that the route table belongs to.


    vpcName string
    The name of the VPC that the route table belongs to.
    create_time str
    The time of creation of the route table, formatted in RFC3339 time string.
    name str
    remark str
    The remarks of the route table. (Default: "").
    route_table_id str
    The ID of the route table.
    route_table_type float
    The type of the route table. 1 is the default route table, 0 is a custom route table.
    subnet_count float
    The number of subnets bound to the route table.
    subnet_ids Sequence[str]
    The list of subnet IDs bound to the route table.
    tag str
    A tag assigned to the route table, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or an empty string is filled in, then the default tag will be assigned. (Default: Default).
    vpc_id str
    The ID of the VPC that the route table belongs to.


    vpc_name str
    The name of the VPC that the route table belongs to.
    createTime String
    The time of creation of the route table, formatted in RFC3339 time string.
    name String
    remark String
    The remarks of the route table. (Default: "").
    routeTableId String
    The ID of the route table.
    routeTableType Number
    The type of the route table. 1 is the default route table, 0 is a custom route table.
    subnetCount Number
    The number of subnets bound to the route table.
    subnetIds List<String>
    The list of subnet IDs bound to the route table.
    tag String
    A tag assigned to the route table, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or an empty string is filled in, then the default tag will be assigned. (Default: Default).
    vpcId String
    The ID of the VPC that the route table belongs to.


    vpcName String
    The name of the VPC that the route table belongs to.

    Import

    Route Table can be imported using the id, e.g.

    $ pulumi import ucloud:index/routeTable:RouteTable example routetable-abc123456
    

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

    Package Details

    Repository
    ucloud ucloud/terraform-provider-ucloud
    License
    Notes
    This Pulumi package is based on the ucloud Terraform Provider.
    Viewing docs for ucloud 1.45.0
    published on Thursday, Sep 24, 2026 by ucloud

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial