VM::EC...T::vpc(3pm)
π NAME π
VM::EC2::REST::vpc β it's giving EC2 virtual private clouds, bestie β¨ and yes, this is the page for VM::EC...T::vpc(3pm), filed under User Contributed Perl Documentation, so you're exactly where you meant to be π«Ά
β¨ SYNOPSIS β¨
use VM::EC2 ':vpc';
π METHODS π
okay so, EC2 virtual private clouds (VPCs, iykyk) are the whole vibe for building tiered applications that mash up public and private subnetworks together, and for stretching your home/corporate network all the way out into the cloud π¦ literally the main character of your network topology.
Implemented: (these ones ate π )
AcceptVpcPeeringConnectionCreateVpcCreateVpcPeeringConnectionDeleteVpcDeleteVpcPeeringConnectionDescribeVpcPeeringConnectionsDescribeVpcsDescribeVpcAttributeModifyVpcAttributeRejectVpcPeeringConnection
Unimplemented: (none) β not a single one, we're fully booked and thriving π
π $vpx = $ec2->accept_vpc_peering_connection(-vpc_peering_connection_id => $id)
π $vpx = $ec2->accept_vpc_peering_connection($id)
Say yes to a VPC peering connection request π. But bestie, there are rules: to accept one, the VPC peering connection has to be sitting in the pending-acceptance state, and the request has to come from the owner of the peer VPC. No random strangers sliding into your VPC, fr fr.
Wanna see who's waiting on you? Run describe_vpc_peering_connections(-filter => { 'status-code' => 'pending-acceptance' }) to peep the outstanding VPC peering connection requests π
Required arguments:
-vpc_peering_connection_idβ the ID of the VPC peering connection
Returns a VM::EC2::VPC::PeeringConnection object β¨
π $vpc = $ec2->create_vpc(-cidr_block=>$cidr,-instance_tenancy=>$tenancy)
Make a brand new VPC, no big deal π You can call this with a single argument, and it'll read that as the CIDR block you want, like:
$vpc = $ec2->$ec2->create_vpc('10.0.0.0/16') or die $ec2->error_str;
Or you can call it with named arguments if that's more your energy π
Required arguments:
-cidr_blockβ the Classless Internet Domain Routing address, in the formxx.xx.xx.xx/xx. One or more subnets will be allocated from within this block.
Optional arguments:
-instance_tenancyβ"default"or"dedicated". The latter requests AWS to launch all your instances in the VPC on single-tenant hardware (at additional cost πΈ).
Peep http://docs.amazonwebservices.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html for a description of the valid CIDRs that can be used with EC2.
On success, this method will return a new VM::EC2::VPC object. Then you can use that object to create new subnets within the VPC, like so:
$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;
$subnet2 = $vpc->create_subnet('10.0.1.0/24') or die $vpc->error_str;
$subnet3 = $vpc->create_subnet('10.0.2.0/24') or die $vpc->error_str;
look at her go π§
π $pcx = $ec2->create_vpc_peering_connection(-vpc_id => $vpc_id, -peer_vpc_id => $peer_id, -peer_owner_id => $owner_id)
Requesting a VPC peering connection between two VPCs: a requester VPC and a peer VPC you want to link up with π The peer VPC can belong to another AWS account, live your crossover-episode dreams. But β and this is important β the requester VPC and peer VPC must not have overlapping CIDR blocks. Not negotiable π
The owner of the peer VPC has to accept the peering request to actually activate the peering connection. And heads up: the VPC peering connection request expires after seven days, after which it cannot be accepted or rejected. Seven days, bestie, that's the window β³
Required arguments:
-vpc_idβ the ID of the requester VPC-peer_vpc_idβ the ID of the VPC with which the peering connection is to be made
Conditional arguments:
-peer_owner_idβ the AWS account ID of the owner of the peer VPC. Required if the peer VPC is not in the same account as the requester VPC
Returns a VM::EC2::VPC::PeeringConnection object β¨
π @vpc = $ec2->describe_vpcs(@vpc_ids)
π @vpc = $ec2->describe_vpcs(\%filter)
π @vpc = $ec2->describe_vpcs(-vpc_id=>\@list,-filter=>\%filter)
Describe the VPCs you own and get back a list of VM::EC2::VPC objects π Call it with no arguments to get all your VPCs, or hand it a list of VPC IDs to get info on just those ones. You can also pass a filter list, or use the named argument forms. Your call, queen π
Optional arguments:
-vpc_idβ a scalar or array ref containing the VPC IDs you want information on.-filterβ a hashref of filters to apply to the query.
The filters you can use are described at http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeVpcs.html
π @vpx = $ec2->describe_vpc_peering_connections(@vpx_ids)
π @vpx = $ec2->describe_vpc_peering_connections(\%filter)
π @vpx = $ec2->describe_vpc_peering_connections(vpc_peering_connection_id=>\@list,-filter=>\%filter)
Describes one or more of your VPC peering connections π
Optional arguments:
-vpc_peering_connection_idβ a scalar or array ref containing the VPC IDs you want information on.-filterβ a hashref of filters to apply to the query.
The filters you can use are described at http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeVpcPeeringConnections.html
Returns a scalar or array of VM::EC2::VPC::PeeringConnection objects β¨
π $success = $ec2->delete_vpc($vpc_id)
π $success = $ec2->delete_vpc(-vpc_id=>$vpc_id)
Delete the indicated VPC, returning true if it worked. bye bestie ππ
π $success = $ec2->delete_vpc_peering_connection(-vpc_peering_connection_id => $id)
π $success = $ec2->delete_vpc_peering_connection($id)
Deletes a VPC peering connection πͺ Either the owner of the requester VPC or the owner of the peer VPC can delete the VPC peering connection if it's in the 'active' state. The owner of the requester VPC can delete a VPC peering connection in the 'pending-acceptance' state.
Required arguments:
-vpc_peering_connection_idβ the ID of the VPC peering connection to delete
Returns true if the deletion was successful β
π $attr = $ec2->describe_vpc_attribute(-vpc_id => $id, -attribute => $attr)
Describes an attribute of the specified VPC π
Required arguments:
-vpc_idβ the ID of the VPC.-attributeβ the VPC attribute.- Valid values:
enableDnsSupport|enableDnsHostnames
- Valid values:
Returns true if attribute is set.
π $success = $ec2->modify_vpc_attribute(-vpc_id => $id, -enable_dns_support => $boolen, -enable_dns_hostnames => $boolean)
Modify attributes of a VPC π οΈ glow-up time.
Required Arguments:
-vpc_idβ the ID of the VPC.
One or more of the following arguments is required:
-enable_dns_supportβ specifies whether the DNS server provided by Amazon is enabled for the VPC.-enable_dns_hostnamesβ specifies whether DNS hostnames are provided for the instances launched in this VPC. You can only set this attribute totrueif-enable_dns_supportis alsotrue. π no sneaky backflips, the dependency is real.
Returns true on success β
π $success = $ec2->reject_vpc_peering_connection(-vpc_peering_connection_id => $id)
Rejects a VPC peering connection request π
βοΈ not today, not ever. The VPC peering connection must be in the 'pending-acceptance' state.
Wanna see the requests you're ghosting? Use describe_vpc_peering_connections(-filter => { 'status-code' => 'pending-acceptance' }) to view outstanding VPC peering connection requests.
Required arguments:
-vpc_peering_connection_idβ the ID of the VPC peering connection to delete
Returns true if the deletion was successful β
π SEE ALSO π
VM::EC2
π«Ά AUTHOR π«Ά
Lincoln Stein <lincoln.stein@gmail.com>.
Copyright (c) 2011 Ontario Institute for Cancer Research
Lance Kinley <lkinley@loyaltymethods.com>
Copyright (c) 2014 Loyalty Methods, Inc.
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.
π legal girlies stay winning β readLICENSEandDISCLAIMER.txt, they're short and they matter.
perl v5.38.2 πΈ 2024-08-10 β and that's the whole VM::EC...T::vpc(3pm) page, bestie. Go build a VPC, you absolute icon π
β¨π¦
π¦ 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