NAME
VM::EC2::VPC::Route -- An entry in a VPC routing table
SYNOPSIS
use VM::EC2;my $ec2 = VM::EC2->new(...);my $table = $ec2->describe_route_tables('rtb-123456');my @routes = $table->routes;foreach my $r (@routes) {print $r->destinationCidrBlock,"\n",$r->gatewayId,"\n",$r->instanceId,"\n",$r->instanceOwnerId,"\n",$r->networkInterfaceId,"\n",$r->state,"\n"my $target = $r->target,"\n"; # an instance, gateway or network interface object}
DESCRIPTION
This object supports the EC2 Virtual Private Cloud route interface, and is used to control the routing of packets within and between subnets. Each route has a destination CIDR address block, and a target gateway, instance or network interface that will receive packets whose destination matches the block. Routes are matched in order from the most specific to the most general.
METHODS
These object methods are supported:
destinationCidrBlock -- The CIDR address block used in the destinationmatch. For example 0.0.0/0 for all packets.gatewayId -- The ID of an internet gateway attached to yourVPC.instanceId -- The ID of an instance in your VPC to act as thedestination for packets. Typically this will bea NAT instance.instanceOwnerId -- The account number of the owner of the instance.networkInterfaceId -- The ID of an Elastic Network Interface to receivepackets matching the destinationstate -- One of "active" or "blackhole". The blackhole stateapplies when the route's target isn't usable forone reason or another.
In addition, the following convenience methods are provided:
target -- Return the target of the route. This method will returna VM::EC2::Instance, VM::EC2::VPC::InternetGateway, orVM::EC2::NetworkInterface object depending on the natureof the target.instance -- If an instance is the target, return the correspondingVM::EC2::Instance objectgateway -- If a gateway is the target, return the correspondingVM::EC2::VPC::InternetGateway object.network_interface -- If a network interface is the target, return thecorresponding VM::EC2::NetworkInterface object.
STRING OVERLOADING
When used in a string context, this object will be interpolated as the destinationCidrBlock
SEE ALSO
VM::EC2 VM::EC2::Generic
AUTHOR
Lincoln Stein <[email protected]>.
Copyright (c) 2012 Ontario Institute for Cancer Research
This package and its accompanying libraries is free software; you can redistribute it and/or modify it under the terms of the GPL (either version 1, or at your option, any later version) or the Artistic License 2.0. Refer to LICENSE for the full license text. In addition, please see DISCLAIMER.txt for disclaimers of warranty.