VM::EC2::Tag(3pm)

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

πŸ’– VM::EC2::Tag πŸ’–

okay bestie, so this is VM::EC2::Tag β€” a lil object that describes a tagged Amazon EC2 resource ✨ it's part of the User Contributed Perl Documentation, and it is genuinely so slay for knowing what's tagged with what 🏷️


✨ SYNOPSIS ✨

like, the whole vibe is this:

use VM::EC2;

$ec2       = VM::EC2->new(...);
@tags = $ec2->describe_tags(-filter=> {'resource-type'=>'volume'});
for my $t (@tags) {
   $id    = $t->resourceId;
   $type  = $t->resourceType;
   $key   = $t->key;
   $value = $t->value;
}

that's it. that's the energy. πŸ’…


🌸 DESCRIPTION 🌸

so this object is what you use to describe an Amazon EC2 tag πŸŽ€ each one carries info about the resource it's tagging, the tag key, and the tag value. tags get handed to you by the VM::EC2->describe_tags() method, no cap.

ngl tho β€” most of the time you do NOT wanna touch this object directly πŸ™ˆ instead you'd:

  • read tags by calling a resource object's tags() method, which returns a hash of key value pairs πŸ‘‘
  • or specify particular tag values as one of the filters in a describe_*() call ✨

that's the main character route, fr fr.


πŸ¦‹ METHODS πŸ¦‹

here's the lineup of object methods, all iconic:

  • resourceId β€” the ID of the resource being tagged πŸ’–
  • resourceType β€” the type of the resource being tagged, e.g. "image" πŸŽ€
  • key β€” the tag key πŸ”‘
  • value β€” the tag value ⭐

πŸ’œ STRING OVERLOADING πŸ’œ

when you use this object in a string context, it will interpolate the resourceId πŸͺ„ like it just knows what you meant. obsessed.


🌈 SEE ALSO 🌈

  • VM::EC2
  • VM::EC2::Generic

go read those too, iykyk 🫢


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

not me ending on legal text but periodt, the license matters bestie πŸ’…

perl v5.38.2 Β· 2024-08-10 Β· and that's the whole VM::EC2::Tag(3pm) situation 🌸 tysm for reading, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from