VM::EC2::VPC(3pm)
π VM::EC2::VPC β the manual page, but make it fashion π
okay bestie, welcome to VM::EC2::VPC, part of the VM::EC2 family of Perl modules β this is the one that lets you manage your EC2 VPC, aka your own lil private corner of the cloud π β¨
β¨ SYNOPSIS β¨
here's the whole vibe, copy-paste ready, no notes:
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;
like, look at that. build a VPC, subnet it, give it a gateway, route table it, route the whole internet at it. iconic behavior ππ₯
πΈ DESCRIPTION πΈ
so for all the methods that every VM::EC2 object shares? those live over in VM::EC2::Generic. go peek at that one, bestie, we're not re-explaining them here π«Ά
π METHODS π
the object methods (the basics, the essentials)
vpcIdβ the ID of the VPC πstateβ where the VPC is at right now (pending,available) β it's giving character developmentcidrBlockβ the CIDR block the VPC coversdhcpOptionsIdβ the ID of the set of DHCP options you've associated with the VPC, or"default"instanceTenancyβ either"dedicated"or"default"isDefaultβ tells you if the VPC is a default VPC π
and ALSO, the convenience methods β¨ (these are the fun ones)
dhcp_options()β hands you back a VM::EC2::VPC::DhcpOptions objectcurrent_state()β refreshes the object, then tells you its state. glow-up first, then vibe check π¦current_status()β same as above, literally identical, it just exists for module consistency. periodt.set_dhcp_options($options)β associates the Dhcp option set with this VPC.$optionscan be a DhcpOptionsId string or a VM::EC2::VPC::DhcpOptions object. wanna assign no Dhcp options at all? use"default"or just pass no arguments πinternet_gateways()β returns the list of internet gateways attached to this VPC, as a list of VM::EC2::VPC::InternetGatewaycreate_subnet($cidr_block [,$availability_zone] )β creates a subnet with the CIDR block you gave it and returns the VM::EC2::VPC::Subnet object. the optional$availability_zoneargument picks the zone for the subnet β skip it and Amazon picks one for you π§create_internet_gateway()β creates an internet gateway and immediately attaches it to this VPC. if it works you get a VM::EC2::VPC::InternetGateway object back π«subnets()β returns the list of subnets attached to this VPC, as a list of VM::EC2::VPC::Subnetroute_tables()β returns the list of route tables attached to this VPC, as a list of VM::EC2::VPC::RouteTable
π STRING OVERLOADING π
when you use this object in a string context, it gets interpolated as the VPC ID. so it just becomes its ID. main character energy fr fr π
π 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.
ok that's the legal bit and you do gotta read it, no skipping, it's the rules πβ¨
and that's the whole page bestie!! this was perl v5.38.2, dated 2024-08-10 β so if you're reading this from the future, hi, you're doing amazing, go build a VPC πΈππ¦
π¦ where this page comes from
- debian trixie: libvm-ec2-perl 1.28-5 Β· Artistic-2.0 OR GPL-1.0-or-later
- ubuntu resolute: libvm-ec2-perl 1.28-5 Β· Artistic-2.0 OR GPL-1.0-or-later
- ubuntu stonking: libvm-ec2-perl 1.28-5 Β· Artistic-2.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms