View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Lincoln D. Stein > VM-EC2 > VM::EC2::VPC



Annotate this POD


New  13
Open  3
View/Report Bugs




 use VM::EC2;
 $ec2       - VM::EC2->new(...);
 $vpc       = $ec2->create_vpc('')     or die $ec2->error_str;
 $subnet1   = $vpc->create_subnet('')  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('' => $gateway) or die $vpc->error_str;


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


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 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.


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


VM::EC2 VM::EC2::Generic


Lincoln Stein <>.

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.

syntax highlighting: