published on Thursday, Sep 17, 2026 by Pulumi
published on Thursday, Sep 17, 2026 by Pulumi
Provides a ENS Network Route Table resource.
Routing table of ENS network.
For information about ENS Network Route Table and how to use it, see What is Network Route Table.
NOTE: Available since v1.291.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const ensRegionId = config.get("ensRegionId") || "cn-hangzhou-31";
const _default = new alicloud.ens.Network("default", {
networkName: name,
description: name,
cidrBlock: "10.0.0.0/8",
ensRegionId: ensRegionId,
});
const defaultNetworkRouteTable = new alicloud.ens.NetworkRouteTable("default", {
networkId: _default.id,
associateType: "Gateway",
routeTableName: name,
description: name,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
ens_region_id = config.get("ensRegionId")
if ens_region_id is None:
ens_region_id = "cn-hangzhou-31"
default = alicloud.ens.Network("default",
network_name=name,
description=name,
cidr_block="10.0.0.0/8",
ens_region_id=ens_region_id)
default_network_route_table = alicloud.ens.NetworkRouteTable("default",
network_id=default.id,
associate_type="Gateway",
route_table_name=name,
description=name)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ens"
"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, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
ensRegionId := "cn-hangzhou-31"
if param := cfg.Get("ensRegionId"); param != "" {
ensRegionId = param
}
_default, err := ens.NewNetwork(ctx, "default", &ens.NetworkArgs{
NetworkName: pulumi.String(name),
Description: pulumi.String(name),
CidrBlock: pulumi.String("10.0.0.0/8"),
EnsRegionId: pulumi.String(ensRegionId),
})
if err != nil {
return err
}
_, err = ens.NewNetworkRouteTable(ctx, "default", &ens.NetworkRouteTableArgs{
NetworkId: _default.ID().ToIDOutput().ToStringOutput(),
AssociateType: pulumi.String("Gateway"),
RouteTableName: pulumi.String(name),
Description: pulumi.String(name),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var ensRegionId = config.Get("ensRegionId") ?? "cn-hangzhou-31";
var @default = new AliCloud.Ens.Network("default", new()
{
NetworkName = name,
Description = name,
CidrBlock = "10.0.0.0/8",
EnsRegionId = ensRegionId,
});
var defaultNetworkRouteTable = new AliCloud.Ens.NetworkRouteTable("default", new()
{
NetworkId = @default.Id,
AssociateType = "Gateway",
RouteTableName = name,
Description = name,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ens.Network;
import com.pulumi.alicloud.ens.NetworkArgs;
import com.pulumi.alicloud.ens.NetworkRouteTable;
import com.pulumi.alicloud.ens.NetworkRouteTableArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 name = config.get("name").orElse("terraform-example");
final var ensRegionId = config.get("ensRegionId").orElse("cn-hangzhou-31");
var default_ = new Network("default", NetworkArgs.builder()
.networkName(name)
.description(name)
.cidrBlock("10.0.0.0/8")
.ensRegionId(ensRegionId)
.build());
var defaultNetworkRouteTable = new NetworkRouteTable("defaultNetworkRouteTable", NetworkRouteTableArgs.builder()
.networkId(default_.id())
.associateType("Gateway")
.routeTableName(name)
.description(name)
.build());
}
}
configuration:
name:
type: string
default: terraform-example
ensRegionId:
type: string
default: cn-hangzhou-31
resources:
default:
type: alicloud:ens:Network
properties:
networkName: ${name}
description: ${name}
cidrBlock: 10.0.0.0/8
ensRegionId: ${ensRegionId}
defaultNetworkRouteTable:
type: alicloud:ens:NetworkRouteTable
name: default
properties:
networkId: ${default.id}
associateType: Gateway
routeTableName: ${name}
description: ${name}
pulumi {
required_providers {
alicloud = {
source = "pulumi/alicloud"
}
}
}
resource "alicloud_ens_network" "default" {
network_name = var.name
description = var.name
cidr_block = "10.0.0.0/8"
ens_region_id = var.ensRegionId
}
resource "alicloud_ens_networkroutetable" "default" {
network_id = alicloud_ens_network.default.id
associate_type = "Gateway"
route_table_name = var.name
description = var.name
}
variable "name" {
type = string
default = "terraform-example"
}
variable "ensRegionId" {
type = string
default = "cn-hangzhou-31"
}
📚 Need more examples? VIEW MORE EXAMPLES
Create NetworkRouteTable Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new NetworkRouteTable(name: string, args: NetworkRouteTableArgs, opts?: CustomResourceOptions);@overload
def NetworkRouteTable(resource_name: str,
args: NetworkRouteTableArgs,
opts: Optional[ResourceOptions] = None)
@overload
def NetworkRouteTable(resource_name: str,
opts: Optional[ResourceOptions] = None,
associate_type: Optional[str] = None,
network_id: Optional[str] = None,
description: Optional[str] = None,
route_table_name: Optional[str] = None)func NewNetworkRouteTable(ctx *Context, name string, args NetworkRouteTableArgs, opts ...ResourceOption) (*NetworkRouteTable, error)public NetworkRouteTable(string name, NetworkRouteTableArgs args, CustomResourceOptions? opts = null)
public NetworkRouteTable(String name, NetworkRouteTableArgs args)
public NetworkRouteTable(String name, NetworkRouteTableArgs args, CustomResourceOptions options)
type: alicloud:ens:NetworkRouteTable
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "alicloud_ens_network_route_table" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args NetworkRouteTableArgs
- 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 NetworkRouteTableArgs
- 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 NetworkRouteTableArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NetworkRouteTableArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NetworkRouteTableArgs
- 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 networkRouteTableResource = new AliCloud.Ens.NetworkRouteTable("networkRouteTableResource", new()
{
AssociateType = "string",
NetworkId = "string",
Description = "string",
RouteTableName = "string",
});
example, err := ens.NewNetworkRouteTable(ctx, "networkRouteTableResource", &ens.NetworkRouteTableArgs{
AssociateType: pulumi.String("string"),
NetworkId: pulumi.String("string"),
Description: pulumi.String("string"),
RouteTableName: pulumi.String("string"),
})
resource "alicloud_ens_network_route_table" "networkRouteTableResource" {
lifecycle {
create_before_destroy = true
}
associate_type = "string"
network_id = "string"
description = "string"
route_table_name = "string"
}
var networkRouteTableResource = new NetworkRouteTable("networkRouteTableResource", NetworkRouteTableArgs.builder()
.associateType("string")
.networkId("string")
.description("string")
.routeTableName("string")
.build());
network_route_table_resource = alicloud.ens.NetworkRouteTable("networkRouteTableResource",
associate_type="string",
network_id="string",
description="string",
route_table_name="string")
const networkRouteTableResource = new alicloud.ens.NetworkRouteTable("networkRouteTableResource", {
associateType: "string",
networkId: "string",
description: "string",
routeTableName: "string",
});
type: alicloud:ens:NetworkRouteTable
properties:
associateType: string
description: string
networkId: string
routeTableName: string
NetworkRouteTable 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 NetworkRouteTable resource accepts the following input properties:
- Associate
Type string - The binding type of the created routing table. Value:
Gateway. - Network
Id string - The network ID.
- Description string
- The description of the routing table. The length is 1 to 256 characters, but it cannot start with
http://orhttps://. - Route
Table stringName - The name of the routing table. The length is 1 to 128 characters, but it cannot start with
http://orhttps://.
- Associate
Type string - The binding type of the created routing table. Value:
Gateway. - Network
Id string - The network ID.
- Description string
- The description of the routing table. The length is 1 to 256 characters, but it cannot start with
http://orhttps://. - Route
Table stringName - The name of the routing table. The length is 1 to 128 characters, but it cannot start with
http://orhttps://.
- associate_
type string - The binding type of the created routing table. Value:
Gateway. - network_
id string - The network ID.
- description string
- The description of the routing table. The length is 1 to 256 characters, but it cannot start with
http://orhttps://. - route_
table_ stringname - The name of the routing table. The length is 1 to 128 characters, but it cannot start with
http://orhttps://.
- associate
Type String - The binding type of the created routing table. Value:
Gateway. - network
Id String - The network ID.
- description String
- The description of the routing table. The length is 1 to 256 characters, but it cannot start with
http://orhttps://. - route
Table StringName - The name of the routing table. The length is 1 to 128 characters, but it cannot start with
http://orhttps://.
- associate
Type string - The binding type of the created routing table. Value:
Gateway. - network
Id string - The network ID.
- description string
- The description of the routing table. The length is 1 to 256 characters, but it cannot start with
http://orhttps://. - route
Table stringName - The name of the routing table. The length is 1 to 128 characters, but it cannot start with
http://orhttps://.
- associate_
type str - The binding type of the created routing table. Value:
Gateway. - network_
id str - The network ID.
- description str
- The description of the routing table. The length is 1 to 256 characters, but it cannot start with
http://orhttps://. - route_
table_ strname - The name of the routing table. The length is 1 to 128 characters, but it cannot start with
http://orhttps://.
- associate
Type String - The binding type of the created routing table. Value:
Gateway. - network
Id String - The network ID.
- description String
- The description of the routing table. The length is 1 to 256 characters, but it cannot start with
http://orhttps://. - route
Table StringName - The name of the routing table. The length is 1 to 128 characters, but it cannot start with
http://orhttps://.
Outputs
All input properties are implicitly available as output properties. Additionally, the NetworkRouteTable resource produces the following output properties:
- Create
Time string - The creation time of the routing table.
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Default boolGateway Route Table - Whether it is the default gateway route table.
- Route
Table stringId - The ID of the routing table.
- Route
Table stringType - The type of the routing table. Value:
Custom,System. - Status string
- The status of the routing table.
- Create
Time string - The creation time of the routing table.
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Default boolGateway Route Table - Whether it is the default gateway route table.
- Route
Table stringId - The ID of the routing table.
- Route
Table stringType - The type of the routing table. Value:
Custom,System. - Status string
- The status of the routing table.
- create_
time string - The creation time of the routing table.
- id string
- The provider-assigned unique ID for this managed resource.
- is_
default_ boolgateway_ route_ table - Whether it is the default gateway route table.
- route_
table_ stringid - The ID of the routing table.
- route_
table_ stringtype - The type of the routing table. Value:
Custom,System. - status string
- The status of the routing table.
- create
Time String - The creation time of the routing table.
- id String
- The provider-assigned unique ID for this managed resource.
- is
Default BooleanGateway Route Table - Whether it is the default gateway route table.
- route
Table StringId - The ID of the routing table.
- route
Table StringType - The type of the routing table. Value:
Custom,System. - status String
- The status of the routing table.
- create
Time string - The creation time of the routing table.
- id string
- The provider-assigned unique ID for this managed resource.
- is
Default booleanGateway Route Table - Whether it is the default gateway route table.
- route
Table stringId - The ID of the routing table.
- route
Table stringType - The type of the routing table. Value:
Custom,System. - status string
- The status of the routing table.
- create_
time str - The creation time of the routing table.
- id str
- The provider-assigned unique ID for this managed resource.
- is_
default_ boolgateway_ route_ table - Whether it is the default gateway route table.
- route_
table_ strid - The ID of the routing table.
- route_
table_ strtype - The type of the routing table. Value:
Custom,System. - status str
- The status of the routing table.
- create
Time String - The creation time of the routing table.
- id String
- The provider-assigned unique ID for this managed resource.
- is
Default BooleanGateway Route Table - Whether it is the default gateway route table.
- route
Table StringId - The ID of the routing table.
- route
Table StringType - The type of the routing table. Value:
Custom,System. - status String
- The status of the routing table.
Look up Existing NetworkRouteTable Resource
Get an existing NetworkRouteTable 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?: NetworkRouteTableState, opts?: CustomResourceOptions): NetworkRouteTable@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
associate_type: Optional[str] = None,
create_time: Optional[str] = None,
description: Optional[str] = None,
is_default_gateway_route_table: Optional[bool] = None,
network_id: Optional[str] = None,
route_table_id: Optional[str] = None,
route_table_name: Optional[str] = None,
route_table_type: Optional[str] = None,
status: Optional[str] = None) -> NetworkRouteTablefunc GetNetworkRouteTable(ctx *Context, name string, id IDInput, state *NetworkRouteTableState, opts ...ResourceOption) (*NetworkRouteTable, error)public static NetworkRouteTable Get(string name, Input<string> id, NetworkRouteTableState? state, CustomResourceOptions? opts = null)public static NetworkRouteTable get(String name, Output<String> id, NetworkRouteTableState state, CustomResourceOptions options)resources: _: type: alicloud:ens:NetworkRouteTable get: id: ${id}import {
to = alicloud_ens_network_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.
- Associate
Type string - The binding type of the created routing table. Value:
Gateway. - Create
Time string - The creation time of the routing table.
- Description string
- The description of the routing table. The length is 1 to 256 characters, but it cannot start with
http://orhttps://. - Is
Default boolGateway Route Table - Whether it is the default gateway route table.
- Network
Id string - The network ID.
- Route
Table stringId - The ID of the routing table.
- Route
Table stringName - The name of the routing table. The length is 1 to 128 characters, but it cannot start with
http://orhttps://. - Route
Table stringType - The type of the routing table. Value:
Custom,System. - Status string
- The status of the routing table.
- Associate
Type string - The binding type of the created routing table. Value:
Gateway. - Create
Time string - The creation time of the routing table.
- Description string
- The description of the routing table. The length is 1 to 256 characters, but it cannot start with
http://orhttps://. - Is
Default boolGateway Route Table - Whether it is the default gateway route table.
- Network
Id string - The network ID.
- Route
Table stringId - The ID of the routing table.
- Route
Table stringName - The name of the routing table. The length is 1 to 128 characters, but it cannot start with
http://orhttps://. - Route
Table stringType - The type of the routing table. Value:
Custom,System. - Status string
- The status of the routing table.
- associate_
type string - The binding type of the created routing table. Value:
Gateway. - create_
time string - The creation time of the routing table.
- description string
- The description of the routing table. The length is 1 to 256 characters, but it cannot start with
http://orhttps://. - is_
default_ boolgateway_ route_ table - Whether it is the default gateway route table.
- network_
id string - The network ID.
- route_
table_ stringid - The ID of the routing table.
- route_
table_ stringname - The name of the routing table. The length is 1 to 128 characters, but it cannot start with
http://orhttps://. - route_
table_ stringtype - The type of the routing table. Value:
Custom,System. - status string
- The status of the routing table.
- associate
Type String - The binding type of the created routing table. Value:
Gateway. - create
Time String - The creation time of the routing table.
- description String
- The description of the routing table. The length is 1 to 256 characters, but it cannot start with
http://orhttps://. - is
Default BooleanGateway Route Table - Whether it is the default gateway route table.
- network
Id String - The network ID.
- route
Table StringId - The ID of the routing table.
- route
Table StringName - The name of the routing table. The length is 1 to 128 characters, but it cannot start with
http://orhttps://. - route
Table StringType - The type of the routing table. Value:
Custom,System. - status String
- The status of the routing table.
- associate
Type string - The binding type of the created routing table. Value:
Gateway. - create
Time string - The creation time of the routing table.
- description string
- The description of the routing table. The length is 1 to 256 characters, but it cannot start with
http://orhttps://. - is
Default booleanGateway Route Table - Whether it is the default gateway route table.
- network
Id string - The network ID.
- route
Table stringId - The ID of the routing table.
- route
Table stringName - The name of the routing table. The length is 1 to 128 characters, but it cannot start with
http://orhttps://. - route
Table stringType - The type of the routing table. Value:
Custom,System. - status string
- The status of the routing table.
- associate_
type str - The binding type of the created routing table. Value:
Gateway. - create_
time str - The creation time of the routing table.
- description str
- The description of the routing table. The length is 1 to 256 characters, but it cannot start with
http://orhttps://. - is_
default_ boolgateway_ route_ table - Whether it is the default gateway route table.
- network_
id str - The network ID.
- route_
table_ strid - The ID of the routing table.
- route_
table_ strname - The name of the routing table. The length is 1 to 128 characters, but it cannot start with
http://orhttps://. - route_
table_ strtype - The type of the routing table. Value:
Custom,System. - status str
- The status of the routing table.
- associate
Type String - The binding type of the created routing table. Value:
Gateway. - create
Time String - The creation time of the routing table.
- description String
- The description of the routing table. The length is 1 to 256 characters, but it cannot start with
http://orhttps://. - is
Default BooleanGateway Route Table - Whether it is the default gateway route table.
- network
Id String - The network ID.
- route
Table StringId - The ID of the routing table.
- route
Table StringName - The name of the routing table. The length is 1 to 128 characters, but it cannot start with
http://orhttps://. - route
Table StringType - The type of the routing table. Value:
Custom,System. - status String
- The status of the routing table.
Import
ENS Network Route Table can be imported using the id, e.g.
$ pulumi import alicloud:ens/networkRouteTable:NetworkRouteTable example <route_table_id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
published on Thursday, Sep 17, 2026 by Pulumi