Scroll to navigation

VM::EC2::VPC::Route(3pm) User Contributed Perl Documentation VM::EC2::VPC::Route(3pm)

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 destination
                         match. For example 0.0.0/0 for all packets.
 gatewayId            -- The ID of an internet gateway attached to your
                         VPC.
 instanceId           -- The ID of an instance in your VPC to act as the
                         destination for packets. Typically this will be
                         a NAT instance.
 instanceOwnerId      -- The account number of the owner of the instance.
 networkInterfaceId   -- The ID of an Elastic Network Interface to receive
                         packets matching the destination
 state                -- One of "active" or "blackhole". The blackhole state
                         applies when the route's target isn't usable for
                         one reason or another.

In addition, the following convenience methods are provided:

 target       -- Return the target of the route. This method will return
                 a VM::EC2::Instance, VM::EC2::VPC::InternetGateway, or
                 VM::EC2::NetworkInterface object depending on the nature
                 of the target.
 instance     -- If an instance is the target, return the corresponding
                 VM::EC2::Instance object
 gateway      -- If a gateway is the target, return the corresponding
                 VM::EC2::VPC::InternetGateway object.
 network_interface -- If a network interface is the target, return the
                 corresponding 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 <lincoln.stein@gmail.com>.

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.

2024-08-10 perl v5.38.2