Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
published on Thursday, Sep 17, 2026 by Pulumi
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
published on Thursday, Sep 17, 2026 by Pulumi
This data source provides the ENS Network Route Tables of the current Alibaba Cloud user.
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 defaultNetwork = 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: defaultNetwork.id,
associateType: "Gateway",
routeTableName: name,
description: name,
});
const _default = alicloud.ens.getNetworkRouteTablesOutput({
routeTableId: defaultNetworkRouteTable.routeTableId,
});
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_network = 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_network.id,
associate_type="Gateway",
route_table_name=name,
description=name)
default = alicloud.ens.get_network_route_tables_output(route_table_id=default_network_route_table.route_table_id)
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
}
defaultNetwork, 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
}
defaultNetworkRouteTable, err := ens.NewNetworkRouteTable(ctx, "default", &ens.NetworkRouteTableArgs{
NetworkId: defaultNetwork.ID().ToIDOutput().ToStringOutput(),
AssociateType: pulumi.String("Gateway"),
RouteTableName: pulumi.String(name),
Description: pulumi.String(name),
})
if err != nil {
return err
}
_ = ens.GetNetworkRouteTablesOutput(ctx, ens.GetNetworkRouteTablesOutputArgs{
RouteTableId: defaultNetworkRouteTable.RouteTableId,
}, nil)
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 defaultNetwork = 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 = defaultNetwork.Id,
AssociateType = "Gateway",
RouteTableName = name,
Description = name,
});
var @default = AliCloud.Ens.GetNetworkRouteTables.Invoke(new()
{
RouteTableId = defaultNetworkRouteTable.RouteTableId,
});
});
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 com.pulumi.alicloud.ens.EnsFunctions;
import com.pulumi.alicloud.ens.inputs.GetNetworkRouteTablesArgs;
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 defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.networkName(name)
.description(name)
.cidrBlock("10.0.0.0/8")
.ensRegionId(ensRegionId)
.build());
var defaultNetworkRouteTable = new NetworkRouteTable("defaultNetworkRouteTable", NetworkRouteTableArgs.builder()
.networkId(defaultNetwork.id())
.associateType("Gateway")
.routeTableName(name)
.description(name)
.build());
final var default = EnsFunctions.getNetworkRouteTables(GetNetworkRouteTablesArgs.builder()
.routeTableId(defaultNetworkRouteTable.routeTableId())
.build());
}
}
configuration:
name:
type: string
default: terraform-example
ensRegionId:
type: string
default: cn-hangzhou-31
resources:
defaultNetwork:
type: alicloud:ens:Network
name: default
properties:
networkName: ${name}
description: ${name}
cidrBlock: 10.0.0.0/8
ensRegionId: ${ensRegionId}
defaultNetworkRouteTable:
type: alicloud:ens:NetworkRouteTable
name: default
properties:
networkId: ${defaultNetwork.id}
associateType: Gateway
routeTableName: ${name}
description: ${name}
variables:
default:
fn::invoke:
function: alicloud:ens:getNetworkRouteTables
arguments:
routeTableId: ${defaultNetworkRouteTable.routeTableId}
pulumi {
required_providers {
alicloud = {
source = "pulumi/alicloud"
}
}
}
data "alicloud_ens_getnetworkroutetables" "default" {
route_table_id = alicloud_ens_networkroutetable.default.route_table_id
}
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"
}
Using getNetworkRouteTables
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getNetworkRouteTables(args: GetNetworkRouteTablesArgs, opts?: InvokeOptions): Promise<GetNetworkRouteTablesResult>
function getNetworkRouteTablesOutput(args: GetNetworkRouteTablesOutputArgs, opts?: InvokeOutputOptions): Output<GetNetworkRouteTablesResult>def get_network_route_tables(associate_type: Optional[str] = None,
network_id: Optional[str] = None,
output_file: Optional[str] = None,
route_table_id: Optional[str] = None,
route_table_name: Optional[str] = None,
route_table_type: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetNetworkRouteTablesResult
def get_network_route_tables_output(associate_type: pulumi.Input[Optional[str]] = None,
network_id: pulumi.Input[Optional[str]] = None,
output_file: pulumi.Input[Optional[str]] = None,
route_table_id: pulumi.Input[Optional[str]] = None,
route_table_name: pulumi.Input[Optional[str]] = None,
route_table_type: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetNetworkRouteTablesResult]func GetNetworkRouteTables(ctx *Context, args *GetNetworkRouteTablesArgs, opts ...InvokeOption) (*GetNetworkRouteTablesResult, error)
func GetNetworkRouteTablesOutput(ctx *Context, args *GetNetworkRouteTablesOutputArgs, opts ...InvokeOption) GetNetworkRouteTablesResultOutput> Note: This function is named GetNetworkRouteTables in the Go SDK.
public static class GetNetworkRouteTables
{
public static Task<GetNetworkRouteTablesResult> InvokeAsync(GetNetworkRouteTablesArgs args, InvokeOptions? opts = null)
public static Output<GetNetworkRouteTablesResult> Invoke(GetNetworkRouteTablesInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetNetworkRouteTablesResult> Invoke(GetNetworkRouteTablesInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetNetworkRouteTablesResult> getNetworkRouteTables(GetNetworkRouteTablesArgs args, InvokeOptions options)
public static Output<GetNetworkRouteTablesResult> getNetworkRouteTables(GetNetworkRouteTablesArgs args, InvokeOptions options)
public static Output<GetNetworkRouteTablesResult> getNetworkRouteTables(GetNetworkRouteTablesArgs args, InvokeOutputOptions options)
fn::invoke:
function: alicloud:ens/getNetworkRouteTables:getNetworkRouteTables
arguments:
# arguments dictionarydata "alicloud_ens_get_network_route_tables" "name" {
# arguments
}The following arguments are supported:
- Associate
Type string - The binding type of the routing table. Value:
VSwitch,Gateway. - Network
Id string - The network ID.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Route
Table stringId - The ID of the routing table.
- Route
Table stringName - The name of the routing table.
- Route
Table stringType - The type of the routing table. Value:
Custom,System.
- Associate
Type string - The binding type of the routing table. Value:
VSwitch,Gateway. - Network
Id string - The network ID.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Route
Table stringId - The ID of the routing table.
- Route
Table stringName - The name of the routing table.
- Route
Table stringType - The type of the routing table. Value:
Custom,System.
- associate_
type string - The binding type of the routing table. Value:
VSwitch,Gateway. - network_
id string - The network ID.
- output_
file string - File name where to save data source results (after running
pulumi preview). - route_
table_ stringid - The ID of the routing table.
- route_
table_ stringname - The name of the routing table.
- route_
table_ stringtype - The type of the routing table. Value:
Custom,System.
- associate
Type String - The binding type of the routing table. Value:
VSwitch,Gateway. - network
Id String - The network ID.
- output
File String - File name where to save data source results (after running
pulumi preview). - route
Table StringId - The ID of the routing table.
- route
Table StringName - The name of the routing table.
- route
Table StringType - The type of the routing table. Value:
Custom,System.
- associate
Type string - The binding type of the routing table. Value:
VSwitch,Gateway. - network
Id string - The network ID.
- output
File string - File name where to save data source results (after running
pulumi preview). - route
Table stringId - The ID of the routing table.
- route
Table stringName - The name of the routing table.
- route
Table stringType - The type of the routing table. Value:
Custom,System.
- associate_
type str - The binding type of the routing table. Value:
VSwitch,Gateway. - network_
id str - The network ID.
- output_
file str - File name where to save data source results (after running
pulumi preview). - route_
table_ strid - The ID of the routing table.
- route_
table_ strname - The name of the routing table.
- route_
table_ strtype - The type of the routing table. Value:
Custom,System.
- associate
Type String - The binding type of the routing table. Value:
VSwitch,Gateway. - network
Id String - The network ID.
- output
File String - File name where to save data source results (after running
pulumi preview). - route
Table StringId - The ID of the routing table.
- route
Table StringName - The name of the routing table.
- route
Table StringType - The type of the routing table. Value:
Custom,System.
getNetworkRouteTables Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- A list of routing table IDs.
- Names List<string>
- A list of routing table names.
- Tables
List<Pulumi.
Ali Cloud. Ens. Outputs. Get Network Route Tables Table> - A list of routing tables. Each element contains the following attributes:
- Associate
Type string - The binding type of the routing table.
- Network
Id string - The network ID.
- Output
File string - Route
Table stringId - The ID of the routing table.
- Route
Table stringName - The name of the routing table.
- Route
Table stringType - The type of the routing table.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- A list of routing table IDs.
- Names []string
- A list of routing table names.
- Tables
[]Get
Network Route Tables Table - A list of routing tables. Each element contains the following attributes:
- Associate
Type string - The binding type of the routing table.
- Network
Id string - The network ID.
- Output
File string - Route
Table stringId - The ID of the routing table.
- Route
Table stringName - The name of the routing table.
- Route
Table stringType - The type of the routing table.
- id string
- The provider-assigned unique ID for this managed resource.
- ids list(string)
- A list of routing table IDs.
- names list(string)
- A list of routing table names.
- tables list(object)
- A list of routing tables. Each element contains the following attributes:
- associate_
type string - The binding type of the routing table.
- network_
id string - The network ID.
- output_
file string - route_
table_ stringid - The ID of the routing table.
- route_
table_ stringname - The name of the routing table.
- route_
table_ stringtype - The type of the routing table.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of routing table IDs.
- names List<String>
- A list of routing table names.
- tables
List<Get
Network Route Tables Table> - A list of routing tables. Each element contains the following attributes:
- associate
Type String - The binding type of the routing table.
- network
Id String - The network ID.
- output
File String - route
Table StringId - The ID of the routing table.
- route
Table StringName - The name of the routing table.
- route
Table StringType - The type of the routing table.
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- A list of routing table IDs.
- names string[]
- A list of routing table names.
- tables
Get
Network Route Tables Table[] - A list of routing tables. Each element contains the following attributes:
- associate
Type string - The binding type of the routing table.
- network
Id string - The network ID.
- output
File string - route
Table stringId - The ID of the routing table.
- route
Table stringName - The name of the routing table.
- route
Table stringType - The type of the routing table.
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- A list of routing table IDs.
- names Sequence[str]
- A list of routing table names.
- tables
Sequence[Get
Network Route Tables Table] - A list of routing tables. Each element contains the following attributes:
- associate_
type str - The binding type of the routing table.
- network_
id str - The network ID.
- output_
file str - route_
table_ strid - The ID of the routing table.
- route_
table_ strname - The name of the routing table.
- route_
table_ strtype - The type of the routing table.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of routing table IDs.
- names List<String>
- A list of routing table names.
- tables List<Property Map>
- A list of routing tables. Each element contains the following attributes:
- associate
Type String - The binding type of the routing table.
- network
Id String - The network ID.
- output
File String - route
Table StringId - The ID of the routing table.
- route
Table StringName - The name of the routing table.
- route
Table StringType - The type of the routing table.
Supporting Types
GetNetworkRouteTablesTable
- Associate
Type string - The binding type of the routing table. Value:
VSwitch,Gateway. - Create
Time string - The creation time of the routing table.
- Description string
- The description of the routing table.
- Id string
- The ID of the routing table. Same as
routeTableId. - 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.
- 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 routing table. Value:
VSwitch,Gateway. - Create
Time string - The creation time of the routing table.
- Description string
- The description of the routing table.
- Id string
- The ID of the routing table. Same as
routeTableId. - 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.
- 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 routing table. Value:
VSwitch,Gateway. - create_
time string - The creation time of the routing table.
- description string
- The description of the routing table.
- id string
- The ID of the routing table. Same as
routeTableId. - 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.
- 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 routing table. Value:
VSwitch,Gateway. - create
Time String - The creation time of the routing table.
- description String
- The description of the routing table.
- id String
- The ID of the routing table. Same as
routeTableId. - 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.
- 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 routing table. Value:
VSwitch,Gateway. - create
Time string - The creation time of the routing table.
- description string
- The description of the routing table.
- id string
- The ID of the routing table. Same as
routeTableId. - 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.
- 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 routing table. Value:
VSwitch,Gateway. - create_
time str - The creation time of the routing table.
- description str
- The description of the routing table.
- id str
- The ID of the routing table. Same as
routeTableId. - 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.
- 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 routing table. Value:
VSwitch,Gateway. - create
Time String - The creation time of the routing table.
- description String
- The description of the routing table.
- id String
- The ID of the routing table. Same as
routeTableId. - 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.
- route
Table StringType - The type of the routing table. Value:
Custom,System. - status String
- The status of the routing table.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
published on Thursday, Sep 17, 2026 by Pulumi