getRouteTables

This data source provides a list of Route Tables owned by an Alibaba Cloud account.

NOTE: Available in 1.36.0+.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.RouteTable;
import com.pulumi.alicloud.vpc.RouteTableArgs;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetRouteTablesArgs;
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("route-tables-datasource-example-name");
var fooNetwork = new Network("fooNetwork", NetworkArgs.builder()
.cidrBlock("172.16.0.0/12")
.vpcName(name)
.build());
var fooRouteTable = new RouteTable("fooRouteTable", RouteTableArgs.builder()
.description(name)
.routeTableName(name)
.vpcId(fooNetwork.id())
.build());
final var fooRouteTables = VpcFunctions.getRouteTables(GetRouteTablesArgs.builder()
.ids(fooRouteTable.id())
.build());
ctx.export("routeTableIds", fooRouteTables.applyValue(getRouteTablesResult -> getRouteTablesResult).applyValue(fooRouteTables -> fooRouteTables.applyValue(getRouteTablesResult -> getRouteTablesResult.ids())));
}
}

Return

A collection of values returned by getRouteTables.

Parameters

argument

A collection of arguments for invoking getRouteTables.


suspend fun getRouteTables(ids: List<String>? = null, nameRegex: String? = null, outputFile: String? = null, pageNumber: Int? = null, pageSize: Int? = null, resourceGroupId: String? = null, routeTableName: String? = null, routerId: String? = null, routerType: String? = null, status: String? = null, tags: Map<String, Any>? = null, vpcId: String? = null): GetRouteTablesResult

Return

A collection of values returned by getRouteTables.

See also

Parameters

ids

A list of Route Tables IDs.

nameRegex

A regex string to filter route tables by name.

outputFile

File name where to save data source results (after running pulumi preview).

pageNumber
pageSize
resourceGroupId

The Id of resource group which route tables belongs.

routeTableName

The route table name.

routerId

The router ID.

routerType

The route type of route table. Valid values: VRouter and VBR.

status

The status of resource. Valid values: Available and Pending.

tags

A mapping of tags to assign to the resource.

vpcId

Vpc id of the route table.


Return

A collection of values returned by getRouteTables.

See also

Parameters

argument

Builder for com.pulumi.alicloud.vpc.kotlin.inputs.GetRouteTablesPlainArgs.