VM::EC...stic_ip(3pm)

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

πŸ’– VM::EC2::REST::elastic_ip πŸ’–

okay bestie, gather round, because this is the VM::EC2::REST::elastic_ip page from the VM::EC2 family (it lives in the 3pm manuals, iykyk) and it's literally all about elastic IP addresses: allocating them, sticking them onto instances, and yeeting them into the void when you're done. πŸ¦‹


✨ NAME ✨

VM::EC2::REST::elastic_ip β€” Allocate, attach and delete elastic IP addresses. periodt. πŸ’…


🌸 SYNOPSIS 🌸

use VM::EC2 ':standard';

that's it. that's the whole synopsis. iconic behavior honestly. ✨


πŸŽ€ METHODS πŸŽ€

The methods in this section allow you to allocate elastic IP addresses, attach them to instances, and delete them. See VM::EC2::ElasticAddress. πŸ’–

Implemented:

AllocateAddress
AssociateAddress
DescribeAddresses
DissociateAddress
ReleaseAddress

Unimplemented:

(none)

not a single one missing, we ate and left no crumbs πŸ‘‘


πŸ’œ @addr = $ec2->describe_addresses(@public_ips)

πŸ’œ @addr = $ec2->describe_addresses(-public_ip=>\@addr,-allocation_id=>\@id,-filter->\%filters)

Queries AWS for a list of elastic IP addresses already allocated to you. Every single argument is optional, so you can just vibe and ask for everything:

  • -public_ip β€” An IP address (in dotted format) or an arrayref of addresses to return information about. πŸ“
  • -allocation_id β€” An allocation ID or arrayref of such IDs. Only applicable to VPC addresses. πŸ”₯
  • -filter β€” A hashref of tag=>value pairs to filter the response on. 🌈

The list of applicable filters can be found at http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeAddresses.html.

This method returns a list of VM::EC2::ElasticAddress. 🫢


πŸ’œ $address_info = $ec2->allocate_address([-vpc=>1])

Request an elastic IP address. Pass -vpc=>1 to allocate a VPC elastic address. The return object is a VM::EC2::ElasticAddress. go get your lil IP bestie, she's yours now ✨


πŸ’œ $boolean = $ec2->release_address($addr)

Release an elastic IP address. For non-VPC addresses, you may provide either an IP address string, or a VM::EC2::ElasticAddress. For VPC addresses, you must obtain a VM::EC2::ElasticAddress first (e.g. with describe_addresses) and then pass that to the method. no shortcuts on that one bestie, sorry 😭


πŸ’œ $result = $ec2->associate_address($elastic_addr => $instance_id)

Associate an elastic address with an instance id. Both arguments are mandatory β€” neither one is optional, don't try it. πŸ™ˆ

If you are associating a VPC elastic IP address with the instance, the result code will indicate the associationId. Otherwise it will be a simple perl truth value ("1") if successful, undef if false.

If this is an ordinary EC2 Elastic IP address, the first argument may either be an ordinary string (xx.xx.xx.xx format) or a VM::EC2::ElasticAddress object. However, if it is a VPC elastic IP address, then the argument must be a VM::EC2::ElasticAddress as returned by describe_addresses(). The reason for this is that the allocationId must be retrieved from the object in order to use in the call. so real, the object is carrying secrets you literally cannot get anywhere else πŸ’…


πŸ’œ $bool = $ec2->disassociate_address($elastic_addr)

Disassociate an elastic address from whatever instance it is currently associated with, if any. The result will be true if disassociation was successful. it's giving "we're not together anymore" πŸ’”

If this is an ordinary EC2 Elastic IP address, the argument may either be an ordinary string (xx.xx.xx.xx format) or a VM::EC2::ElasticAddress object. However, if it is a VPC elastic IP address, then the argument must be a VM::EC2::ElasticAddress as returned by describe_addresses(). The reason for this is that the allocationId must be retrieved from the object in order to use in the call. same deal as associate_address, the VPC route is object-only, no cap 🧚


πŸ¦‹ SEE ALSO πŸ¦‹

  • VM::EC2

πŸ‘‘ AUTHOR πŸ‘‘

Lincoln Stein <lincoln.stein@gmail.com>.

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.


fr fr, that's the whole page. every option, every return value, every "you must pass a VM::EC2::ElasticAddress" β€” all accounted for, no crumbs left behind πŸ’–

and that's a wrap on this one, bestie β€” brought to you by perl v5.38.2, dated 2024-08-10, in the VM::EC2::REST::elastic_ip(3pm) era. slay, stay elastic, and always release_address your IPs before you ghost AWS πŸŒˆβœ¨πŸ’…

πŸ“¦ where this page comes from