1. Registry
  2. Packages
  3. Alibaba Cloud Provider
  4. API Docs
  5. ens
  6. NetworkRouteTable
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
alicloud logo alicloud logo
Viewing docs for Alibaba Cloud v3.108.0
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:

    AssociateType string
    The binding type of the created routing table. Value: Gateway.
    NetworkId 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:// or https://.
    RouteTableName string
    The name of the routing table. The length is 1 to 128 characters, but it cannot start with http:// or https://.
    AssociateType string
    The binding type of the created routing table. Value: Gateway.
    NetworkId 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:// or https://.
    RouteTableName string
    The name of the routing table. The length is 1 to 128 characters, but it cannot start with http:// or https://.
    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:// or https://.
    route_table_name string
    The name of the routing table. The length is 1 to 128 characters, but it cannot start with http:// or https://.
    associateType String
    The binding type of the created routing table. Value: Gateway.
    networkId 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:// or https://.
    routeTableName String
    The name of the routing table. The length is 1 to 128 characters, but it cannot start with http:// or https://.
    associateType string
    The binding type of the created routing table. Value: Gateway.
    networkId 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:// or https://.
    routeTableName string
    The name of the routing table. The length is 1 to 128 characters, but it cannot start with http:// or https://.
    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:// or https://.
    route_table_name str
    The name of the routing table. The length is 1 to 128 characters, but it cannot start with http:// or https://.
    associateType String
    The binding type of the created routing table. Value: Gateway.
    networkId 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:// or https://.
    routeTableName String
    The name of the routing table. The length is 1 to 128 characters, but it cannot start with http:// or https://.

    Outputs

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

    CreateTime string
    The creation time of the routing table.
    Id string
    The provider-assigned unique ID for this managed resource.
    IsDefaultGatewayRouteTable bool
    Whether it is the default gateway route table.
    RouteTableId string
    The ID of the routing table.
    RouteTableType string
    The type of the routing table. Value: Custom, System.
    Status string
    The status of the routing table.
    CreateTime string
    The creation time of the routing table.
    Id string
    The provider-assigned unique ID for this managed resource.
    IsDefaultGatewayRouteTable bool
    Whether it is the default gateway route table.
    RouteTableId string
    The ID of the routing table.
    RouteTableType string
    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_gateway_route_table bool
    Whether it is the default gateway route table.
    route_table_id string
    The ID of the routing table.
    route_table_type string
    The type of the routing table. Value: Custom, System.
    status string
    The status of the routing table.
    createTime String
    The creation time of the routing table.
    id String
    The provider-assigned unique ID for this managed resource.
    isDefaultGatewayRouteTable Boolean
    Whether it is the default gateway route table.
    routeTableId String
    The ID of the routing table.
    routeTableType String
    The type of the routing table. Value: Custom, System.
    status String
    The status of the routing table.
    createTime string
    The creation time of the routing table.
    id string
    The provider-assigned unique ID for this managed resource.
    isDefaultGatewayRouteTable boolean
    Whether it is the default gateway route table.
    routeTableId string
    The ID of the routing table.
    routeTableType string
    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_gateway_route_table bool
    Whether it is the default gateway route table.
    route_table_id str
    The ID of the routing table.
    route_table_type str
    The type of the routing table. Value: Custom, System.
    status str
    The status of the routing table.
    createTime String
    The creation time of the routing table.
    id String
    The provider-assigned unique ID for this managed resource.
    isDefaultGatewayRouteTable Boolean
    Whether it is the default gateway route table.
    routeTableId String
    The ID of the routing table.
    routeTableType String
    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) -> NetworkRouteTable
    func 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.
    The following state arguments are supported:
    AssociateType string
    The binding type of the created routing table. Value: Gateway.
    CreateTime 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:// or https://.
    IsDefaultGatewayRouteTable bool
    Whether it is the default gateway route table.
    NetworkId string
    The network ID.
    RouteTableId string
    The ID of the routing table.
    RouteTableName string
    The name of the routing table. The length is 1 to 128 characters, but it cannot start with http:// or https://.
    RouteTableType string
    The type of the routing table. Value: Custom, System.
    Status string
    The status of the routing table.
    AssociateType string
    The binding type of the created routing table. Value: Gateway.
    CreateTime 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:// or https://.
    IsDefaultGatewayRouteTable bool
    Whether it is the default gateway route table.
    NetworkId string
    The network ID.
    RouteTableId string
    The ID of the routing table.
    RouteTableName string
    The name of the routing table. The length is 1 to 128 characters, but it cannot start with http:// or https://.
    RouteTableType string
    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:// or https://.
    is_default_gateway_route_table bool
    Whether it is the default gateway route table.
    network_id string
    The network ID.
    route_table_id string
    The ID of the routing table.
    route_table_name string
    The name of the routing table. The length is 1 to 128 characters, but it cannot start with http:// or https://.
    route_table_type string
    The type of the routing table. Value: Custom, System.
    status string
    The status of the routing table.
    associateType String
    The binding type of the created routing table. Value: Gateway.
    createTime 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:// or https://.
    isDefaultGatewayRouteTable Boolean
    Whether it is the default gateway route table.
    networkId String
    The network ID.
    routeTableId String
    The ID of the routing table.
    routeTableName String
    The name of the routing table. The length is 1 to 128 characters, but it cannot start with http:// or https://.
    routeTableType String
    The type of the routing table. Value: Custom, System.
    status String
    The status of the routing table.
    associateType string
    The binding type of the created routing table. Value: Gateway.
    createTime 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:// or https://.
    isDefaultGatewayRouteTable boolean
    Whether it is the default gateway route table.
    networkId string
    The network ID.
    routeTableId string
    The ID of the routing table.
    routeTableName string
    The name of the routing table. The length is 1 to 128 characters, but it cannot start with http:// or https://.
    routeTableType string
    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:// or https://.
    is_default_gateway_route_table bool
    Whether it is the default gateway route table.
    network_id str
    The network ID.
    route_table_id str
    The ID of the routing table.
    route_table_name str
    The name of the routing table. The length is 1 to 128 characters, but it cannot start with http:// or https://.
    route_table_type str
    The type of the routing table. Value: Custom, System.
    status str
    The status of the routing table.
    associateType String
    The binding type of the created routing table. Value: Gateway.
    createTime 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:// or https://.
    isDefaultGatewayRouteTable Boolean
    Whether it is the default gateway route table.
    networkId String
    The network ID.
    routeTableId String
    The ID of the routing table.
    routeTableName String
    The name of the routing table. The length is 1 to 128 characters, but it cannot start with http:// or https://.
    routeTableType String
    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 alicloud Terraform Provider.
    alicloud logo alicloud logo
    Viewing docs for Alibaba Cloud v3.108.0
    published on Thursday, Sep 17, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial