VM::EC2::VPC(3pm)

πŸ“¦
version 1.28 Β· 7 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– 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 development
  • 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 β€” 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 object
  • current_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. $options can 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::InternetGateway
  • create_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_zone argument 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::Subnet
  • route_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