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:

RouteTableId string

The ID of the router table to which the route entry belongs.

CidrBlock string

The destination CIDR block of the route entry.

InstanceId string

The instance ID of the next hop.

OutputFile string
Type string

The type of the route entry.

RouteTableId string

The ID of the router table to which the route entry belongs.

CidrBlock string

The destination CIDR block of the route entry.

InstanceId string

The instance ID of the next hop.

OutputFile string
Type string

The type of the route entry.

routeTableId string

The ID of the router table to which the route entry belongs.

cidrBlock string

The destination CIDR block of the route entry.

instanceId string

The instance ID of the next hop.

outputFile string
type string

The type of the route entry.

route_table_id str

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.AliCloud.Vpc.Outputs.GetRouteEntriesEntry>

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

Id string

The provider-assigned unique ID for this managed resource.

RouteTableId string

The ID of the router table to which the route entry belongs.

CidrBlock string

The destination CIDR block of the route entry.

InstanceId string

The instance ID of the next hop.

OutputFile string
Type string

The type of the route entry.

Entries []GetRouteEntriesEntry

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

Id string

The provider-assigned unique ID for this managed resource.

RouteTableId string

The ID of the router table to which the route entry belongs.

CidrBlock string

The destination CIDR block of the route entry.

InstanceId string

The instance ID of the next hop.

OutputFile string
Type string

The type of the route entry.

entries GetRouteEntriesEntry[]

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

id string

The provider-assigned unique ID for this managed resource.

routeTableId string

The ID of the router table to which the route entry belongs.

cidrBlock string

The destination CIDR block of the route entry.

instanceId string

The instance ID of the next hop.

outputFile string
type string

The type of the route entry.

entries List[GetRouteEntriesEntry]

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

id str

The provider-assigned unique ID for this managed resource.

route_table_id str

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.

CidrBlock string

The destination CIDR block of the route entry.

InstanceId string

The instance ID of the next hop.

NextHopType string

The type of the next hop.

RouteTableId string

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.

CidrBlock string

The destination CIDR block of the route entry.

InstanceId string

The instance ID of the next hop.

NextHopType string

The type of the next hop.

RouteTableId string

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.

cidrBlock string

The destination CIDR block of the route entry.

instanceId string

The instance ID of the next hop.

nextHopType string

The type of the next hop.

routeTableId string

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.

nextHopType str

The type of the next hop.

route_table_id str

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 alicloud Terraform Provider.