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

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

πŸ’– 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::EC2
  • VM::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 and LICENSE and DISCLAIMER.txt are 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