VM::EC2::VPC3pm
Manage ec2 vpc
Usage
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;
Overview
Please see VM::EC2::Generic for methods shared by all VM::EC2 objects.
Methods
These object methods are supported:
vpcId -- ID of the VPCstate -- 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 associatedwith 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 statecurrent_status() -- Same as above (for module consistency)set_dhcp_options($options) -- Associate the Dhcp option set withthis 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 tothis VPC as a list of VM::EC2::VPC::InternetGateway.create_subnet($cidr_block [,$availability_zone] )-- Create a subnet with the indicated CIDR block andreturn the VM::EC2::VPC::Subnet object. Theoptional $availability_zone argument selects thezone for the subnet. Otherwise Amazon selects onefor you.create_internet_gateway()-- Create an internet gateway and immediately attachit to this VPC. If successful returns aVM::EC2::VPC::InternetGateway object.subnets() -- Return the list of subnets attached to this VPCas a list of VM::EC2::VPC::Subnet.route_tables() -- Return the list of route tables attached to this VPCas a list of VM::EC2::VPC::RouteTable.
String overloading
When used in a string context, this object will be interpolated as the VPC ID.
Releases
6 releases since Debian 8 (Jessie); the text changed 3 times.