published on Thursday, Sep 24, 2026 by ucloud
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:
- 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 stringId - 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 stringId - 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_ stringid - 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 StringId - 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 stringId - 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_ strid - 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).
- 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 StringId - 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:
- 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 doubleType - The type of the route table.
1is the default route table,0is a custom route table. - Subnet
Count double - 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.
- 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 float64Type - The type of the route table.
1is the default route table,0is a custom route table. - Subnet
Count float64 - The number of subnets bound to the route table.
- Subnet
Ids []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.
- 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_ numbertype - The type of the route table.
1is the default route table,0is 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.
- 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 DoubleType - The type of the route table.
1is the default route table,0is a custom route table. - subnet
Count Double - 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.
- 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 numberType - The type of the route table.
1is the default route table,0is a custom route table. - subnet
Count number - The number of subnets bound to the route table.
- subnet
Ids 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.
- 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_ floattype - The type of the route table.
1is the default route table,0is 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.
- 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 NumberType - The type of the route table.
1is the default route table,0is 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.
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) -> RouteTablefunc 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.
- 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 stringId - The ID of the route table.
- Route
Table doubleType - The type of the route table.
1is the default route table,0is a custom route table. - Subnet
Count double - 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.
- 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 stringId - The ID of the route table.
- Route
Table float64Type - The type of the route table.
1is the default route table,0is a custom route table. - Subnet
Count float64 - The number of subnets bound to the route table.
- Subnet
Ids []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.
- 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_ stringid - The ID of the route table.
- route_
table_ numbertype - The type of the route table.
1is the default route table,0is 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.
- 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 StringId - The ID of the route table.
- route
Table DoubleType - The type of the route table.
1is the default route table,0is a custom route table. - subnet
Count Double - 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.
- 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 stringId - The ID of the route table.
- route
Table numberType - The type of the route table.
1is the default route table,0is a custom route table. - subnet
Count number - The number of subnets bound to the route table.
- subnet
Ids 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.
- 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_ strid - The ID of the route table.
- route_
table_ floattype - The type of the route table.
1is the default route table,0is 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.
- 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 StringId - The ID of the route table.
- route
Table NumberType - The type of the route table.
1is the default route table,0is 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.
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
ucloudTerraform Provider.
published on Thursday, Sep 24, 2026 by ucloud