GetRouteEntries
This data source provides a list of Route Entries owned by an Alibaba Cloud account.
NOTE: Available in 1.37.0+.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var defaultZones = Output.Create(AliCloud.GetZones.InvokeAsync(new AliCloud.GetZonesArgs
{
AvailableResourceCreation = "VSwitch",
}));
var defaultInstanceTypes = defaultZones.Apply(defaultZones => Output.Create(AliCloud.Ecs.GetInstanceTypes.InvokeAsync(new AliCloud.Ecs.GetInstanceTypesArgs
{
AvailabilityZone = defaultZones.Zones[0].Id,
CpuCoreCount = 1,
MemorySize = 2,
})));
var defaultImages = Output.Create(AliCloud.Ecs.GetImages.InvokeAsync(new AliCloud.Ecs.GetImagesArgs
{
MostRecent = true,
NameRegex = "^ubuntu_18.*64",
Owners = "system",
}));
var config = new Config();
var name = config.Get("name") ?? "tf-testAccRouteEntryConfig";
var fooNetwork = new AliCloud.Vpc.Network("fooNetwork", new AliCloud.Vpc.NetworkArgs
{
CidrBlock = "10.1.0.0/21",
});
var fooSwitch = new AliCloud.Vpc.Switch("fooSwitch", new AliCloud.Vpc.SwitchArgs
{
AvailabilityZone = defaultZones.Apply(defaultZones => defaultZones.Zones[0].Id),
CidrBlock = "10.1.1.0/24",
VpcId = fooNetwork.Id,
});
var tfTestFoo = new AliCloud.Ecs.SecurityGroup("tfTestFoo", new AliCloud.Ecs.SecurityGroupArgs
{
Description = "foo",
VpcId = fooNetwork.Id,
});
var fooInstance = new AliCloud.Ecs.Instance("fooInstance", new AliCloud.Ecs.InstanceArgs
{
AllocatePublicIp = true,
ImageId = defaultImages.Apply(defaultImages => defaultImages.Images[0].Id),
InstanceChargeType = "PostPaid",
InstanceName = name,
InstanceType = defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.InstanceTypes[0].Id),
InternetChargeType = "PayByTraffic",
InternetMaxBandwidthOut = 5,
SecurityGroups =
{
tfTestFoo.Id,
},
SystemDiskCategory = "cloud_efficiency",
VswitchId = fooSwitch.Id,
});
var fooRouteEntry = new AliCloud.Vpc.RouteEntry("fooRouteEntry", new AliCloud.Vpc.RouteEntryArgs
{
DestinationCidrblock = "172.11.1.1/32",
NexthopId = fooInstance.Id,
NexthopType = "Instance",
RouteTableId = fooNetwork.RouteTableId,
});
var ingress = new AliCloud.Ecs.SecurityGroupRule("ingress", new AliCloud.Ecs.SecurityGroupRuleArgs
{
CidrIp = "0.0.0.0/0",
IpProtocol = "tcp",
NicType = "intranet",
Policy = "accept",
PortRange = "22/22",
Priority = 1,
SecurityGroupId = tfTestFoo.Id,
Type = "ingress",
});
var fooRouteEntries = fooRouteEntry.RouteTableId.Apply(routeTableId => AliCloud.Vpc.GetRouteEntries.InvokeAsync(new AliCloud.Vpc.GetRouteEntriesArgs
{
RouteTableId = routeTableId,
}));
}
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
default_zones = alicloud.get_zones(available_resource_creation="VSwitch")
default_instance_types = alicloud.ecs.get_instance_types(availability_zone=default_zones.zones[0]["id"],
cpu_core_count=1,
memory_size=2)
default_images = alicloud.ecs.get_images(most_recent=True,
name_regex="^ubuntu_18.*64",
owners="system")
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-testAccRouteEntryConfig"
foo_network = alicloud.vpc.Network("fooNetwork", cidr_block="10.1.0.0/21")
foo_switch = alicloud.vpc.Switch("fooSwitch",
availability_zone=default_zones.zones[0]["id"],
cidr_block="10.1.1.0/24",
vpc_id=foo_network.id)
tf_test_foo = alicloud.ecs.SecurityGroup("tfTestFoo",
description="foo",
vpc_id=foo_network.id)
foo_instance = alicloud.ecs.Instance("fooInstance",
allocate_public_ip=True,
image_id=default_images.images[0]["id"],
instance_charge_type="PostPaid",
instance_name=name,
instance_type=default_instance_types.instance_types[0]["id"],
internet_charge_type="PayByTraffic",
internet_max_bandwidth_out=5,
security_groups=[tf_test_foo.id],
system_disk_category="cloud_efficiency",
vswitch_id=foo_switch.id)
foo_route_entry = alicloud.vpc.RouteEntry("fooRouteEntry",
destination_cidrblock="172.11.1.1/32",
nexthop_id=foo_instance.id,
nexthop_type="Instance",
route_table_id=foo_network.route_table_id)
ingress = alicloud.ecs.SecurityGroupRule("ingress",
cidr_ip="0.0.0.0/0",
ip_protocol="tcp",
nic_type="intranet",
policy="accept",
port_range="22/22",
priority=1,
security_group_id=tf_test_foo.id,
type="ingress")
foo_route_entries = foo_route_entry.route_table_id.apply(lambda route_table_id: alicloud.vpc.get_route_entries(route_table_id=route_table_id))import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "tf-testAccRouteEntryConfig";
const defaultZones = pulumi.output(alicloud.getZones({
availableResourceCreation: "VSwitch",
}, { async: true }));
const defaultInstanceTypes = defaultZones.apply(defaultZones => alicloud.ecs.getInstanceTypes({
availabilityZone: defaultZones.zones[0].id,
cpuCoreCount: 1,
memorySize: 2,
}, { async: true }));
const defaultImages = pulumi.output(alicloud.ecs.getImages({
mostRecent: true,
nameRegex: "^ubuntu_18.*64",
owners: "system",
}, { async: true }));
const fooNetwork = new alicloud.vpc.Network("foo", {
cidrBlock: "10.1.0.0/21",
});
const fooSwitch = new alicloud.vpc.Switch("foo", {
availabilityZone: defaultZones.zones[0].id,
cidrBlock: "10.1.1.0/24",
vpcId: fooNetwork.id,
});
const tfTestFoo = new alicloud.ecs.SecurityGroup("tf_test_foo", {
description: "foo",
vpcId: fooNetwork.id,
});
const fooInstance = new alicloud.ecs.Instance("foo", {
allocatePublicIp: true,
imageId: defaultImages.images[0].id,
// series III
instanceChargeType: "PostPaid",
instanceName: name,
instanceType: defaultInstanceTypes.instanceTypes[0].id,
internetChargeType: "PayByTraffic",
internetMaxBandwidthOut: 5,
// cn-beijing
securityGroups: [tfTestFoo.id],
systemDiskCategory: "cloud_efficiency",
vswitchId: fooSwitch.id,
});
const fooRouteEntry = new alicloud.vpc.RouteEntry("foo", {
destinationCidrblock: "172.11.1.1/32",
nexthopId: fooInstance.id,
nexthopType: "Instance",
routeTableId: fooNetwork.routeTableId,
});
const ingress = new alicloud.ecs.SecurityGroupRule("ingress", {
cidrIp: "0.0.0.0/0",
ipProtocol: "tcp",
nicType: "intranet",
policy: "accept",
portRange: "22/22",
priority: 1,
securityGroupId: tfTestFoo.id,
type: "ingress",
});
const fooRouteEntries = fooRouteEntry.routeTableId.apply(routeTableId => alicloud.vpc.getRouteEntries({
routeTableId: routeTableId,
}, { async: true }));Using GetRouteEntries
function getRouteEntries(args: GetRouteEntriesArgs, opts?: InvokeOptions): Promise<GetRouteEntriesResult>function get_route_entries(cidr_block=None, instance_id=None, output_file=None, route_table_id=None, type=None, opts=None)func GetRouteEntries(ctx *Context, args *GetRouteEntriesArgs, opts ...InvokeOption) (*GetRouteEntriesResult, error)public static class GetRouteEntries {
public static Task<GetRouteEntriesResult> InvokeAsync(GetRouteEntriesArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Route
Table stringId The ID of the router table to which the route entry belongs.
- Cidr
Block string The destination CIDR block of the route entry.
- Instance
Id string The instance ID of the next hop.
- Output
File string - Type string
The type of the route entry.
- Route
Table stringId The ID of the router table to which the route entry belongs.
- Cidr
Block string The destination CIDR block of the route entry.
- Instance
Id string The instance ID of the next hop.
- Output
File string - Type string
The type of the route entry.
- route
Table stringId The ID of the router table to which the route entry belongs.
- cidr
Block string The destination CIDR block of the route entry.
- instance
Id string The instance ID of the next hop.
- output
File string - type string
The type of the route entry.
- route_
table_ strid The ID of the router table to which the route entry belongs.
- cidr_
block str The destination CIDR block of the route entry.
- instance_
id str The instance ID of the next hop.
- output_
file str - type str
The type of the route entry.
GetRouteEntries Result
The following output properties are available:
- Entries
List<Pulumi.
Ali Cloud. Vpc. Outputs. Get Route Entries Entry> A list of Route Entries. Each element contains the following attributes:
- Id string
The provider-assigned unique ID for this managed resource.
- Route
Table stringId The ID of the router table to which the route entry belongs.
- Cidr
Block string The destination CIDR block of the route entry.
- Instance
Id string The instance ID of the next hop.
- Output
File string - Type string
The type of the route entry.
- Entries
[]Get
Route Entries Entry A list of Route Entries. Each element contains the following attributes:
- Id string
The provider-assigned unique ID for this managed resource.
- Route
Table stringId The ID of the router table to which the route entry belongs.
- Cidr
Block string The destination CIDR block of the route entry.
- Instance
Id string The instance ID of the next hop.
- Output
File string - Type string
The type of the route entry.
- entries
Get
Route Entries Entry[] A list of Route Entries. Each element contains the following attributes:
- id string
The provider-assigned unique ID for this managed resource.
- route
Table stringId The ID of the router table to which the route entry belongs.
- cidr
Block string The destination CIDR block of the route entry.
- instance
Id string The instance ID of the next hop.
- output
File string - type string
The type of the route entry.
- entries
List[Get
Route Entries Entry] A list of Route Entries. Each element contains the following attributes:
- id str
The provider-assigned unique ID for this managed resource.
- route_
table_ strid The ID of the router table to which the route entry belongs.
- cidr_
block str The destination CIDR block of the route entry.
- instance_
id str The instance ID of the next hop.
- output_
file str - type str
The type of the route entry.
Supporting Types
GetRouteEntriesEntry
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Cidr
Block string The destination CIDR block of the route entry.
- Instance
Id string The instance ID of the next hop.
- Next
Hop stringType The type of the next hop.
- Route
Table stringId The ID of the router table to which the route entry belongs.
- Status string
The status of the route entry.
- Type string
The type of the route entry.
- Cidr
Block string The destination CIDR block of the route entry.
- Instance
Id string The instance ID of the next hop.
- Next
Hop stringType The type of the next hop.
- Route
Table stringId The ID of the router table to which the route entry belongs.
- Status string
The status of the route entry.
- Type string
The type of the route entry.
- cidr
Block string The destination CIDR block of the route entry.
- instance
Id string The instance ID of the next hop.
- next
Hop stringType The type of the next hop.
- route
Table stringId The ID of the router table to which the route entry belongs.
- status string
The status of the route entry.
- type string
The type of the route entry.
- cidr_
block str The destination CIDR block of the route entry.
- instance_
id str The instance ID of the next hop.
- next
Hop strType The type of the next hop.
- route_
table_ strid The ID of the router table to which the route entry belongs.
- status str
The status of the route entry.
- type str
The type of the route entry.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.