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.
- Name
Regex string A regex string to filter route tables by name.
- Output
File string - Resource
Group stringId The Id of resource group which route tables belongs.
- Dictionary<string, object>
A mapping of tags to assign to the resource.
- Vpc
Id string Vpc id of the route table.
- Ids []string
A list of Route Tables IDs.
- Name
Regex string A regex string to filter route tables by name.
- Output
File string - Resource
Group stringId The Id of resource group which route tables belongs.
- map[string]interface{}
A mapping of tags to assign to the resource.
- Vpc
Id string Vpc id of the route table.
- ids string[]
A list of Route Tables IDs.
- name
Regex string A regex string to filter route tables by name.
- output
File string - resource
Group stringId The Id of resource group which route tables belongs.
- {[key: string]: any}
A mapping of tags to assign to the resource.
- vpc
Id 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_ strid The Id of resource group which route tables belongs.
- 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.
Ali Cloud. Vpc. Outputs. Get Route Tables Table> A list of Route Tables. Each element contains the following attributes:
- Name
Regex string - Output
File string - Resource
Group stringId The Id of resource group which route tables belongs.
- Dictionary<string, object>
- Vpc
Id 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
[]Get
Route Tables Table A list of Route Tables. Each element contains the following attributes:
- Name
Regex string - Output
File string - Resource
Group stringId The Id of resource group which route tables belongs.
- map[string]interface{}
- Vpc
Id 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
Get
Route Tables Table[] A list of Route Tables. Each element contains the following attributes:
- name
Regex string - output
File string - resource
Group stringId The Id of resource group which route tables belongs.
- {[key: string]: any}
- vpc
Id 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[Get
Route Tables Table] A list of Route Tables. Each element contains the following attributes:
- name_
regex str - output_
file str - resource_
group_ strid The Id of resource group which route tables belongs.
- 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.
- Creation
Time 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.
- Route
Table stringType The type of route table.
- Router
Id string Router Id of the route table.
- Creation
Time 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.
- Route
Table stringType The type of route table.
- Router
Id string Router Id of the route table.
- creation
Time 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.
- route
Table stringType The type of route table.
- router
Id 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.
- route
Table strType 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
alicloudTerraform Provider.