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

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

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

okay bestie, so this is VM::EC2::REST::reserved_instance (the 3pm one, iykyk) and it's literally all about describing, purchasing and using Reserved Instances ✨ no cap.


✨ SYNOPSIS ✨

use VM::EC2 ':misc'

that's it. that's the whole vibe. πŸŽ€


πŸ’… METHODS πŸ’…

so these methods are the main characters for describing, purchasing and using Reserved Instances. slay.

Implemented: βœ…

CancelReservedInstancesListing
DescribeReservedInstances
DescribeReservedInstancesListings
DescribeReservedInstancesModifications
DescribeReservedInstancesOfferings
ModifyReservedInstances
PurchaseReservedInstancesOffering
CreateReservedInstancesListing

Unimplemented: πŸ™ˆ

(none)
not a single one missing, we ate and left no crumbs fr fr.

@offerings = $ec2->describe_reserved_instances_offerings(@offering_ids)

@offerings = $ec2->describe_reserved_instances_offerings(%args)

This one hands you back a list of the reserved instance offerings that are available to purchase right now. The arguments let you filter the offerings with a whole bunch of filters, okay?

All arguments are optional, bestie. If you don't pass any named arguments, then the arguments get treated as Reserved Instance Offering IDs. πŸ¦‹

  • -reserved_instances_offering_id β€” A scalar or arrayref of reserved instance offering IDs
  • -instance_type β€” The instance type on which the reserved instance can be used, e.g. "c1.medium"
  • -availability_zone, -zone β€” The availability zone in which the reserved instance can be used.
  • -product_description β€” The reserved instance description. Valid values are "Linux/UNIX", "Linux/UNIX (Amazon VPC)", "Windows", and "Windows (Amazon VPC)"
  • -instance_tenancy β€” The tenancy of the reserved instance offering, either "default" or "dedicated". (VPC instances only)
  • -offering_type β€” The reserved instance offering type, one of "Heavy Utilization", "Medium Utilization", or "Light Utilization".
  • -filter β€” A set of filters to apply.

For available filters, see http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeReservedInstancesOfferings.html.

The returned objects are of type VM::EC2::ReservedInstance::Offering πŸ’œ

This can be combined with the Offering purchase() method, like this lil combo here:

@offerings = $ec2->describe_reserved_instances_offerings(
         {'availability-zone'   => 'us-east-1a',
          'instance-type'       => 'c1.medium',
          'product-description' =>'Linux/UNIX',
          'duration'            => 31536000,  # this is 1 year
          });
$offerings[0]->purchase(5) and print "Five reserved instances purchased\n";

the # this is 1 year comment is doing so much heavy lifting there, iconic. πŸ”₯


$id = $ec2->purchase_reserved_instances_offering($offering_id)

$id = $ec2->purchase_reserved_instances_offering(%args)

Purchase one or more reserved instances based on an offering. πŸ’Έ

Arguments:

  • -reserved_instances_offering_id, -id β€” The reserved instance offering ID to purchase (required).
  • -instance_count, -count β€” Number of instances to reserve under this offer (optional, defaults to 1).

Returns a Reserved Instances Id on success, undef on failure. Also see the purchase() method of VM::EC2::ReservedInstance::Offering. πŸ‘‘


@res_instances = $ec2->describe_reserved_instances(@res_instance_ids)

@res_instances = $ec2->describe_reserved_instances(%args)

This method returns a list of the reserved instances that you currently own. The info you get back includes the type of instances that the reservation allows you to launch, the availability zone, and the cost per hour to run those reserved instances. 🫢

All arguments are optional. If no named arguments are used, then the arguments are treated as Reserved Instance IDs.

  • -reserved_instances_id β€” A scalar or arrayref of reserved instance IDs
  • -filter β€” A set of filters to apply.

For available filters, see http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeReservedInstances.html.

The returned objects are of type VM::EC2::ReservedInstance 🌸


$id = $ec2->modify_reserved_instances(%args)

Modifies the Availability Zone, instance count, instance type, or network platform (EC2-Classic or EC2-VPC) of your Reserved Instances. ✨ The Reserved Instances to be modified must be identical, except for Availability Zone, network platform, and instance type.

Required arguments:

  • -reserved_instances_id β€” The IDs of the Reserved Instances to modify. Can be scalar or arrayref.
  • -target_configuration β€” The configuration settings for the Reserved Instances to modify.

Must be a hashref or arrayref of hashes with one or more of the following values:

AvailabilityZone, Platform, InstanceType

The following is also REQUIRED:

InstanceCount
  • -id β€” Alias for -reserved_instances_id

Returns the reserved instances modification ID string. πŸ’«


@mods = $ec2->describe_reserved_instances_modifications(@ids)

@mods = $ec2->describe_reserved_instances_modifications(%args)

Describes the modifications made to your Reserved Instances. 🧚

All arguments are optional. If no named arguments are used, then the arguments are treated as Reserved Instance Modification IDs.

  • -reserved_instances_modification_id β€” A scalar or arrayref of reserved instance modification IDs
  • -filter β€” A set of filters to apply.
  • -id β€” Alias for -reserved_instances_modification_id

For available filters, see: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeReservedInstancesModifications.html

The returned objects are of type VM::EC2::ReservedInstance::Modification ⭐


@list = $ec2->describe_reserved_instances_listings(%args)

Describes the account's Reserved Instance listings in the Reserved Instance Marketplace. πŸ›οΈ

All arguments are optional. If no named arguments are used, then the arguments are treated as Reserved Instance Listing IDs.

  • -reserved_instances_listing_id β€” A scalar or arrayref of reserved instance listing IDs
  • -reserved_instances_id β€” A scalar or arrayref of reserved instance IDs
  • -filter β€” A set of filters to apply.

For available filters, see: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeReservedInstancesListings.html

The returned objects are of type VM::EC2::ReservedInstance::Listing 🌈


$listing = $ec2->cancel_reserved_instances_listing(%args)

Cancels the specified Reserved Instance listing in the Reserved Instance Marketplace. πŸ’€ (rip to that listing)

Required arguments:

  • -reserved_instances_listing_id β€” The ID of the Reserved Instance listing to be canceled

Returns an object of type VM::EC2::ReservedInstance::Listing


$listing = $ec2->create_reserved_instances_listing(%args)

Creates a listing for Amazon EC2 Reserved Instances to be sold in the Reserved Instance Marketplace. πŸ’° Only one Reserved Instance listing may be created at a time.

Required arguments:

  • -reserved_instances_id β€” The ID of the active Reserved Instance
  • -instance_count β€” The number of instances to be listed in the Reserved Instance Marketplace. This number should be less than or equal to the instance count associated with the Reserved Instance ID specified
  • -price_schedules β€” hashref containing term/price pairs for months the Reserved Instance has remaining in its term

For example, with a RI with 11 months to go:

{ 11 => 2.5,
  8 => 2.0,
  5 => 1.5,
  3 => 0.7,
  1 => 0.1 }

For months 11,10,9 the price is $2.50, 8,7,6 is $2.00, 5,4 is $1.50, 3,2 is $0.70 and the last month is $0.10.

For more details, see the API docs at: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-CreateReservedInstancesListing.html

  • -client_token β€” Unique, case-sensitive identifier to ensure idempotency of listings

Returns an object of type VM::EC2::ReservedInstance::Listing πŸŽ€


πŸ‘€ SEE ALSO πŸ‘€

VM::EC2


🫢 AUTHOR 🫢

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

Lance Kinley <lkinley@loyaltymethods.com>.

Copyright (c) 2011 Ontario Institute for Cancer Research

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.


bestie this is perl v5.38.2, dated 2024-08-10, and that's the whole VM::EC2::REST::reserved_instance page πŸ’– mwah, go reserve something responsibly, ily πŸ¦‹βœ¨
πŸ“¦ where this page comes from