VM::EC...ffering(3pm)
π VM::EC2::ReservedInstance::Offering β the manual, but make it make sense π
okay bestie so you know how Amazon EC2 lets you β¨reserveβ¨ instances instead of paying per-hour like a chaotic little gremlin? Yeah. This page is about the object that describes one of those reservation offerings β the thing you look at before you commit. It lives in the VM::EC2 Perl fam, and it's documented under VM::EC2::ReservedInstance::Offering in the 3pm manual section (User Contributed Perl Documentation, iykyk). Let's go π¦
β¨ NAME β¨
VM::EC2::ReservedInstance::Offering β an object that describes an Amazon EC2 reserved instance offering. That's the whole vibe. π
πΈ SYNOPSIS πΈ
okay so here's the little demo of how you'd actually use it, and yes we're keeping every line exactly as-is because copying code is sacred:
use VM::EC2;
$ec2 = VM::EC2->new(...);
@offerings = $ec2->describe_reserved_instances_offerings();
for my $o (@offerings) {
print $o->reservedInstancesOfferingId,"\n";
print $o->instanceType,"\n";
print $o->availabilityZone,"\n";
print $o->duration,"\n";
print $o->fixedPrice,"\n";
print $o->usagePrice,"\n";
print $o->productDescription,"\n";
print $o->instanceTenancy,"\n";
print $o->currencyCode,"\n";
}
# purchase the first one
$offerings[0]->purchase() && print "offer purchased\n";
see how it just grabs all the offerings and prints every single field? and then, iconically, it buys the first one. main character behavior, honestly. π
π DESCRIPTION π
This object is an Amazon EC2 reserved instance offering. Like, that's it. That's the girl. π
You get one back from VM::EC2->describe_reserved_instances_offerings, and then you interrogate it for all its little details. So useful. So fetch.
π¦ METHODS π¦
Here's the roster of methods this object supports, no gatekeeping:
reservedInstancesOfferingIdβ the ID of this offer. its whole identity, its name tag at the party πinstanceTypeβ the instance type on which this reserved instance can be used. which flavor of compute, bestie.availabilityZoneβ the availability zone in which this reserved instance can be used. location location location πdurationβ how long the reserved instance contract lasts, in seconds. yes, seconds. do the math yourself, i'm not your calculator πfixedPriceβ the purchase price of the reserved instance for the indicated version. the one-time bag πΈusagePriceβ the usage price of the reserved instance, per hour. the ongoing bag πΈπΈproductDescriptionβ the reserved instance description. one of"Linux/UNIX","Linux/UNIX (Amazon VPC)","Windows", and"Windows (Amazon VPC)". pick your fighter β¨instanceTenancyβ the tenancy of the reserved instance (VPC only). no cap, it's VPC-only bestie.currencyCodeβ the currency of the reserved instance offering prices. because prices are meaningless without the money unit, fr fr π
And there's also this one, which is the whole point of the operation:
π
$boolean = $offering->purchase($count) π
Buys the offering. Returns true on success, so you can chain it and feel powerful. π«Ά
The optional $count argument is how many reserved instances you wanna purchase β and if you don't say anything, it defaults to 1. so chill.
β οΈ heads up bestie: this is the method that actually spends money. it's not a preview, it's not a vibe check, it's a purchase. go off though π
π STRING OVERLOADING π
When you use this object in a string context, it interpolates the reservedInstancesOfferingId. So if you print $offering; you get the ID, not a sad little HASH(0x...). iconic. we love a good overload. β¨
πΈ SEE ALSO πΈ
VM::EC2VM::EC2::Generic
go read those too, they're the family π
π AUTHOR π
Lincoln Stein <lincoln.stein@gmail.com>. legend behavior. π«Ά
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.
π read the license files, bestie. the GPL and the Artistic License 2.0 andLICENSEandDISCLAIMER.txtare all real and all matter. no skimming. π§
and that's the whole page, mwah π This version came to you from perl v5.38.2, dated 2024-08-10, and it's the VM::EC2::ReservedInstance::Offering page, 3pm, User Contributed Perl Documentation. bye bestie, go reserve responsibly πβπ
π¦ 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