1VM::EC2::VPC::Route(3)User Contributed Perl DocumentationVM::EC2::VPC::Route(3)
2
3
4
6 VM::EC2::VPC::Route -- An entry in a VPC routing table
7
9 use VM::EC2;
10 my $ec2 = VM::EC2->new(...);
11 my $table = $ec2->describe_route_tables('rtb-123456');
12 my @routes = $table->routes;
13
14 foreach my $r (@routes) {
15 print $r->destinationCidrBlock,"\n",
16 $r->gatewayId,"\n",
17 $r->instanceId,"\n",
18 $r->instanceOwnerId,"\n",
19 $r->networkInterfaceId,"\n",
20 $r->state,"\n"
21 my $target = $r->target,"\n"; # an instance, gateway or network interface object
22 }
23
25 This object supports the EC2 Virtual Private Cloud route interface, and
26 is used to control the routing of packets within and between subnets.
27 Each route has a destination CIDR address block, and a target gateway,
28 instance or network interface that will receive packets whose
29 destination matches the block. Routes are matched in order from the
30 most specific to the most general.
31
33 These object methods are supported:
34
35 destinationCidrBlock -- The CIDR address block used in the destination
36 match. For example 0.0.0/0 for all packets.
37 gatewayId -- The ID of an internet gateway attached to your
38 VPC.
39 instanceId -- The ID of an instance in your VPC to act as the
40 destination for packets. Typically this will be
41 a NAT instance.
42 instanceOwnerId -- The account number of the owner of the instance.
43 networkInterfaceId -- The ID of an Elastic Network Interface to receive
44 packets matching the destination
45 state -- One of "active" or "blackhole". The blackhole state
46 applies when the route's target isn't usable for
47 one reason or another.
48
49 In addition, the following convenience methods are provided:
50
51 target -- Return the target of the route. This method will return
52 a VM::EC2::Instance, VM::EC2::VPC::InternetGateway, or
53 VM::EC2::NetworkInterface object depending on the nature
54 of the target.
55
56 instance -- If an instance is the target, return the corresponding
57 VM::EC2::Instance object
58
59 gateway -- If a gateway is the target, return the corresponding
60 VM::EC2::VPC::InternetGateway object.
61
62 network_interface -- If a network interface is the target, return the
63 corresponding VM::EC2::NetworkInterface object.
64
66 When used in a string context, this object will be interpolated as the
67 destinationCidrBlock
68
70 VM::EC2 VM::EC2::Generic
71
73 Lincoln Stein <lincoln.stein@gmail.com>.
74
75 Copyright (c) 2012 Ontario Institute for Cancer Research
76
77 This package and its accompanying libraries is free software; you can
78 redistribute it and/or modify it under the terms of the GPL (either
79 version 1, or at your option, any later version) or the Artistic
80 License 2.0. Refer to LICENSE for the full license text. In addition,
81 please see DISCLAIMER.txt for disclaimers of warranty.
82
83
84
85perl v5.36.0 2023-01-20 VM::EC2::VPC::Route(3)