VM::EC...Reason(3pm)
π 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 ashutdown -hcommand 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::EC2VM::EC2::GenericVM::EC2::StateVM::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
- 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