VM::EC2::VPC::Subnet3pm
Usage
use VM::EC2;my $ec2 = VM::EC2->new(...);my $vpc = $ec2->create_vpc('10.0.0.0/16');my $subnet = $vpc->create_subnet('10.0.0.0/24') or die $vpc->error_str;@subnets = $ec2->describe_subnets;for my $sn (@subnets) {print $sn->subnetId,"\n",$sn->state,"\n",$sn->vpcId,"\n",$sn->cidrBlock,"\n",$sn->availableIpAddressCount,"\n",$sn->availabilityZone,"\n";}
Overview
This object supports the EC2 Virtual Private Cloud subnet interface. Please see VM::EC2::Generic for methods shared by all VM::EC2 objects.
Methods
These object methods are supported:
subnetId -- the ID of the subnetstate -- The current state of the subnet, either "pending" or "available"vpcId -- The ID of the VPC the subnet is in.cidrBlock -- The CIDR block assigned to the subnet.availableIpAddressCount -- The number of unused IP addresses in the subnet.availableZone -- This subnet's availability zone.defaultForAz -- Indicates if this is the default subnet for the Availability ZonemapPublicIpOnLaunch -- Indicates if instances launched in this subnet automatically receive apublic IP address
This class supports the VM::EC2 tagging interface. See VM::EC2::Generic for information.
In addition, this object supports the following convenience methods:
vpc() -- Return the associated VM::EC2::VPC object.zone() -- Return the associated VM::EC2::AvailabilityZone object.refresh() -- Refreshes the object from its current state in EC2.current_state() -- Refreshes the object and returns its current state.create_route_table() -- Create a new route table, associates it with this subnet, andreturns the corresponding VM::EC2::VPC::RouteTableobject.associate_route_table($table)-- Associates a route table with this subnet, returning true ifsucessful.disassociate_route_table($table)-- Removes the association of a route table with this subnet. Producesa fatal error if $table is not associated with the subnet. Returns trueon success.associate_network_acl($network_acl_id)-- Associates a network ACL with this subnet, returning the newassociation ID on success.disassociate_network_acl()-- Removes the association of a network ACL with this subnet. The subnetwill then be associated with the default network ACL. Returns thethe association ID.
String overloading
When used in a string context, this object will be interpolated as the subnet ID.
Releases
6 releases since Debian 8 (Jessie); the text changed 3 times.