get Route Tables
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())));
}
}
Content copied to clipboard
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.
name Regex
A regex string to filter route tables by name.
output File
page Number
page Size
resource Group Id
The Id of resource group which route tables belongs.
route Table Name
The route table name.
router Id
The router ID.
router Type
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.
vpc Id
Vpc id of the route table.
suspend fun getRouteTables(argument: suspend GetRouteTablesPlainArgsBuilder.() -> Unit): GetRouteTablesResult
Return
A collection of values returned by getRouteTables.
See also
Parameters
argument
Builder for com.pulumi.alicloud.vpc.kotlin.inputs.GetRouteTablesPlainArgs.