Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages
VM::EC2::REST::subnet(3) User Contributed Perl Documentation VM::EC2::REST::subnet(3)

 use VM::EC2 ':vpc';

These methods manage subnet objects and the routing among them. A VPC may have a single subnet or many, and routing rules determine whether the subnet has access to the internet ("public"), is entirely private, or is connected to a customer gateway device to form a Virtual Private Network (VPN) in which your home network's address space is extended into the Amazon VPC.
All instances in a VPC are located in one subnet or another. Subnets may be public or private, and are organized in a star topology with a logical router in the middle.
Although all these methods can be called from VM::EC2 objects, many are more conveniently called from the VM::EC2::VPC object family. This allows for steps that typically follow each other, such as creating a route table and associating it with a subnet, happen automatically. For example, this series of calls creates a VPC with a single subnet, creates an Internet gateway attached to the VPC, associates a new route table with the subnet and then creates a default route from the subnet to the Internet gateway.
 $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  = $subnet->create_route_table         or die $vpc->error_str;
 $routeTbl->create_route('' => $gateway) or die $vpc->error_str;

This method creates a new subnet within the given VPC. Pass a VPC object or VPC ID, and a CIDR block string. If successful, the method will return a VM::EC2::VPC::Subnet object.
Required arguments:
 -vpc_id     A VPC ID or previously-created VM::EC2::VPC object.
 -cidr_block A CIDR block string in the form "xx.xx.xx.xx/xx". The
             CIDR address must be within the CIDR block previously
             assigned to the VPC, and must not overlap other subnets
             in the VPC.
Optional arguments:
 -availability_zone  The availability zone for the instances launched
                     within this instance, either an availability zone
                     name, or a VM::EC2::AvailabilityZone object. If
                     this is not specified, then AWS chooses a zone for
                     you automatically.

This method deletes the indicated subnet. It may be called with a single argument consisting of the subnet ID, or a named argument form with the argument -subnet_id.

This method returns a list of VM::EC2::VPC::Subnet objects. Called with no arguments, it returns all Subnets (not filtered by VPC Id). Pass a list of subnet IDs or a filter hashref in order to restrict the search.
Optional arguments:
 -subnet_id     Scalar or arrayref of subnet IDs.
 -filter        Hashref of filters.
Available filters are described at

Modifies a subnet attribute.
Required arguments:
 -subnet_id                 The ID of the subnet to modify.
 -map_public_ip_on_launch   Modifies the public IP addressing behavior for the
                            subnet. Specify true to indicate that instances
                            launched into the specified subnet should be
                            assigned a public IP address. If set to true, the
                            instance receives a public IP address only if the
                            instance is launched with a single, new network
                            interface with the device index of 0.
Returns true on success.


Lincoln Stein <>.
Copyright (c) 2011 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.
2019-01-01 perl v5.28.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.