NAME

VM::EC2::VPC

SYNOPSIS

use VM::EC2;
$ec2       - VM::EC2->new(...);
$vpc       = $ec2->create_vpc('10.0.0.0/16')     or die $ec2->error_str;
$subnet1   = $vpc->create_subnet('10.0.0.0/24')  or die $vpc->error_str;
$gateway   = $vpc->create_internet_gateway       or die $vpc->error_str;
$routeTbl  = $subnet1->create_route_table        or die $vpc->error_str;
$routeTbl->create_route('0.0.0.0/0' => $gateway) or die $vpc->error_str;

DESCRIPTION

Please see VM::EC2::Generic for methods shared by all VM::EC2 objects.

METHODS

These object methods are supported:

vpcId         -- ID of the VPC
state         -- Current state of the VPC (pending, available)
cidrBlock     -- The CIDR block the VPC covers.
dhcpOptionsId -- The ID of the set of DHCP options you've associated
                 with the VPC, or "default".
instanceTenancy  -- Either "dedicated" or "default"
isDefault        -- Indicates if the VPC is a default VPC

In addition, this object supports the following convenience methods:

dhcp_options()   -- Return a VM::EC2::VPC::DhcpOptions object.

current_state()  -- Refresh the object and then return its state

current_status() -- Same as above (for module consistency)

set_dhcp_options($options) -- Associate the Dhcp option set with
      this VPC (DhcpOptionsId string or VM::EC2::VPC::DhcpOptions object).
      Use "default" or pass no arguments to assign no Dhcp options.

internet_gateways() -- Return the list of internet gateways attached to
                       this VPC as a list of VM::EC2::VPC::InternetGateway.

create_subnet($cidr_block [,$availability_zone] )
                    -- Create a subnet with the indicated CIDR block and
                       return the VM::EC2::VPC::Subnet object. The
                       optional $availability_zone argument selects the
                       zone for the subnet. Otherwise Amazon selects one
                       for you.

create_internet_gateway()
                    -- Create an internet gateway and immediately attach
                       it to this VPC. If successful returns a 
                       VM::EC2::VPC::InternetGateway object.

subnets()           -- Return the list of subnets attached to this VPC
                       as a list of VM::EC2::VPC::Subnet.

route_tables()      -- Return the list of route tables attached to this VPC
                       as a list of VM::EC2::VPC::RouteTable.

STRING OVERLOADING

When used in a string context, this object will be interpolated as the VPC ID.

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.