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

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

πŸ’– VM::EC2::State::Reason πŸ’–

okay bestie, welcome to VM::EC2::State::Reason β€” the little object that tells you why your EC2 instance ghosted you and changed state. it's a Perl module, it lives in the User Contributed Perl Documentation, and it is, genuinely, iconic for how much drama it explains. ✨


🌸 SYNOPSIS 🌸

here's the whole vibe, copy-paste ready:

use VM::EC2;

$ec2      = VM::EC2->new(...);
$instance = $ec2->describe_instances(-instance_id=>'i-12345');
$reason   = $instance->reason;
$code     = $reason->code;
$message  = $reason->message;

see how easy that was? grab your VM::EC2 object, describe an instance, ask for its reason, and boom β€” you've got a code and a message. slay. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so this object? it represents the reason an Amazon EC2 instance went through a state change. like, the receipts. the explanation. the "why did you do this to me" note.

you get one by calling the reason() method on VM::EC2::Instance. that's it. that's the door. πŸšͺ✨


πŸ’… METHODS πŸ’…

these are the object methods you get, no cap:

  • code β€” the state change reason code.
  • message β€” the state change reason message. (the original page says "method" here β€” a little typo moment, we still love her πŸ’€)

now here's the good part, the code-and-message menu. source: http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-ItemType-StateReasonType.html

  • Server.SpotInstanceTermination β€” a Spot Instance got terminated because the market price went up. πŸ’Έ
  • Server.InternalError β€” an internal error happened while the instance was launching, and it got terminated because of it.
  • Server.InsufficientInstanceCapacity β€” there just wasn't enough instance capacity to satisfy the launch request.
  • Client.InternalError β€” a client error made the instance terminate on launch.
  • Client.InstanceInitiatedShutdown β€” the instance itself initiated shutdown, by way of a shutdown -h command issued from inside the instance. it did this to itself 😭
  • Client.UserInitiatedShutdown β€” a user shut the instance down via an API call. that was you, bestie.
  • Client.VolumeLimitExceeded β€” the volume limit got exceeded.
  • Client.InvalidSnapshot.NotFound β€” the snapshot you specified was not found. gone. not there. πŸ™ˆ

✨ STRING OVERLOADING ✨

when you use this object in a string context, it interpolates the message. so you can just drop it into a string and it'll speak for itself. main character behavior fr.


πŸŽ€ SEE ALSO πŸŽ€

go read these too, they're all in the family:

  • VM::EC2
  • VM::EC2::Generic
  • VM::EC2::State
  • VM::EC2::Instance

πŸ‘‘ 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.


and that's the whole page, babe 🌈 this was perl v5.38.2, dated 2024-08-10, and yes it's the User Contributed Perl Documentation version of VM::EC2::State::Reason πŸ’œ mwah, go read your LICENSE and DISCLAIMER.txt, stay hydrated, periodt. πŸ“πŸ§š

πŸ“¦ where this page comes from