GetRouteTables

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

NOTE: Available in 1.36.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var name = config.Get("name") ?? "route-tables-datasource-example-name";
        var fooNetwork = new AliCloud.Vpc.Network("fooNetwork", new AliCloud.Vpc.NetworkArgs
        {
            CidrBlock = "172.16.0.0/12",
        });
        var fooRouteTable = new AliCloud.Vpc.RouteTable("fooRouteTable", new AliCloud.Vpc.RouteTableArgs
        {
            Description = name,
            VpcId = fooNetwork.Id,
        });
        var fooRouteTables = fooRouteTable.Id.Apply(id => AliCloud.Vpc.GetRouteTables.InvokeAsync(new AliCloud.Vpc.GetRouteTablesArgs
        {
            Ids = 
            {
                id,
            },
        }));
        this.RouteTableIds = fooRouteTables.Apply(fooRouteTables => fooRouteTables.Ids);
    }

    [Output("routeTableIds")]
    public Output<string> RouteTableIds { get; set; }
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "route-tables-datasource-example-name"
foo_network = alicloud.vpc.Network("fooNetwork", cidr_block="172.16.0.0/12")
foo_route_table = alicloud.vpc.RouteTable("fooRouteTable",
    description=name,
    vpc_id=foo_network.id)
foo_route_tables = foo_route_table.id.apply(lambda id: alicloud.vpc.get_route_tables(ids=[id]))
pulumi.export("routeTableIds", foo_route_tables.ids)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "route-tables-datasource-example-name";

const fooNetwork = new alicloud.vpc.Network("foo", {
    cidrBlock: "172.16.0.0/12",
});
const fooRouteTable = new alicloud.vpc.RouteTable("foo", {
    description: name,
    vpcId: fooNetwork.id,
});
const fooRouteTables = fooRouteTable.id.apply(id => alicloud.vpc.getRouteTables({
    ids: [id],
}, { async: true }));

export const routeTableIds = fooRouteTables.ids!;

Using GetRouteTables

function getRouteTables(args: GetRouteTablesArgs, opts?: InvokeOptions): Promise<GetRouteTablesResult>
function  get_route_tables(ids=None, name_regex=None, output_file=None, resource_group_id=None, tags=None, vpc_id=None, opts=None)
func GetRouteTables(ctx *Context, args *GetRouteTablesArgs, opts ...InvokeOption) (*GetRouteTablesResult, error)
public static class GetRouteTables {
    public static Task<GetRouteTablesResult> InvokeAsync(GetRouteTablesArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Ids List<string>

A list of Route Tables IDs.

NameRegex string

A regex string to filter route tables by name.

OutputFile string
ResourceGroupId string

The Id of resource group which route tables belongs.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

VpcId string

Vpc id of the route table.

Ids []string

A list of Route Tables IDs.

NameRegex string

A regex string to filter route tables by name.

OutputFile string
ResourceGroupId string

The Id of resource group which route tables belongs.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

VpcId string

Vpc id of the route table.

ids string[]

A list of Route Tables IDs.

nameRegex string

A regex string to filter route tables by name.

outputFile string
resourceGroupId string

The Id of resource group which route tables belongs.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

vpcId string

Vpc id of the route table.

ids List[str]

A list of Route Tables IDs.

name_regex str

A regex string to filter route tables by name.

output_file str
resource_group_id str

The Id of resource group which route tables belongs.

tags Dict[str, Any]

A mapping of tags to assign to the resource.

vpc_id str

Vpc id of the route table.

GetRouteTables Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

(Optional) A list of Route Tables IDs.

Names List<string>

A list of Route Tables names.

Tables List<Pulumi.AliCloud.Vpc.Outputs.GetRouteTablesTable>

A list of Route Tables. Each element contains the following attributes:

NameRegex string
OutputFile string
ResourceGroupId string

The Id of resource group which route tables belongs.

Tags Dictionary<string, object>
VpcId string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string

(Optional) A list of Route Tables IDs.

Names []string

A list of Route Tables names.

Tables []GetRouteTablesTable

A list of Route Tables. Each element contains the following attributes:

NameRegex string
OutputFile string
ResourceGroupId string

The Id of resource group which route tables belongs.

Tags map[string]interface{}
VpcId string
id string

The provider-assigned unique ID for this managed resource.

ids string[]

(Optional) A list of Route Tables IDs.

names string[]

A list of Route Tables names.

tables GetRouteTablesTable[]

A list of Route Tables. Each element contains the following attributes:

nameRegex string
outputFile string
resourceGroupId string

The Id of resource group which route tables belongs.

tags {[key: string]: any}
vpcId string
id str

The provider-assigned unique ID for this managed resource.

ids List[str]

(Optional) A list of Route Tables IDs.

names List[str]

A list of Route Tables names.

tables List[GetRouteTablesTable]

A list of Route Tables. Each element contains the following attributes:

name_regex str
output_file str
resource_group_id str

The Id of resource group which route tables belongs.

tags Dict[str, Any]
vpc_id str

Supporting Types

GetRouteTablesTable

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

CreationTime string

Time of creation.

Description string

The description of the route table instance.

Id string

ID of the Route Table.

Name string

Name of the route table.

RouteTableType string

The type of route table.

RouterId string

Router Id of the route table.

CreationTime string

Time of creation.

Description string

The description of the route table instance.

Id string

ID of the Route Table.

Name string

Name of the route table.

RouteTableType string

The type of route table.

RouterId string

Router Id of the route table.

creationTime string

Time of creation.

description string

The description of the route table instance.

id string

ID of the Route Table.

name string

Name of the route table.

routeTableType string

The type of route table.

routerId string

Router Id of the route table.

creation_time str

Time of creation.

description str

The description of the route table instance.

id str

ID of the Route Table.

name str

Name of the route table.

routeTableType str

The type of route table.

router_id str

Router Id of the route table.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.