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

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

πŸ’– VM::EC2::NetworkInterface::Attachment πŸ’–

okay bestie, welcome to the VM::EC2::NetworkInterface::Attachment page, straight out of the User Contributed Perl Documentation section. this is the little guy that represents a network interface getting attached to an instance. it's giving "glue object" and honestly? we're obsessed. πŸ¦‹


✨ NAME ✨

VM::EC2::NetworkInterface::Attachment β€” the object that represents the attachment of a network interface to an instance. no cap, that's literally the whole job. πŸ’…


🌸 SYNOPSIS 🌸

okay so here's the vibe in code form:

use VM::EC2;
my $ec2 = VM::EC2->new(...);
my $instance = $ec2->describe_instances('i-123456');
my @interfaces = $instance->network_interfaces();
for my $i (@interfaces) {
   my $attachment = $i->attachment;
   my $att_id      = $attachment->attachmentId;
   my $ins_id      = $attachment->instanceId;
   my $instance    = $attachment->instance;
   my $device      = $attachment->device;
   my $status      = $attachment->status;
   my $time        = $attachment->attachmentTime;
   my $delete      = $attachment->deleteOnTermination;
}

like, you grab the attachment off the interface and then you're just pulling fields off it like it's a group chat and you're catching up. main character energy fr fr. ✨


πŸŽ€ DESCRIPTION πŸŽ€

this object describes the attachment of a elastic network interface (ENI) to an instance β€” and yes, it doesn't just sit there looking pretty, it also lets you manipulate the attachment. so it's decorative and functional. iconic. πŸ‘‘

also, please go look at VM::EC2::Generic for the methods that every single VM::EC2 object shares, because we're not about to re-explain those here. iykyk. 🫢


πŸ’… METHODS πŸ’…

these object methods are supported, and no we are not skipping any of them:

  • attachmentId β€” the ID of the attachment
  • instanceId β€” the ID of the instance
  • instanceOwnerId β€” the ID of the owner of the instance
  • deviceIndex β€” the Ethernet device number, like "0" for eth0
  • status β€” always "attached"; more on this below, don't @ me
  • attachmentTime β€” the time this ENI was attached to the instance, as a DateTime
  • deleteOnTermination β€” if this is true, this ENI gets deleted when the instance terminates. so like, gone gone. πŸ’€

ngl, Amazon does not document the network interface attachment object well, and a lot of these fields are inferred by inspection of EC2 REST responses. so it's a bit of detective work, bestie. πŸ”

in particular: the status field always seems to be "attached", but there may be another state, such as "pending", which is too short lived to be apparent. so it exists in theory and we simply never catch it in the act. πŸ™ˆ

on top of all that, this object also supports the following convenience methods:

  • instance β€” the VM::EC2::Instance to which the ENI is attached. your little link back home. 🏠

🌈 STRING OVERLOADING 🌈

when you use this object in a string context, it gets interpolated as the attachmentId. so it just becomes its own ID. slay. πŸ’–


⭐ SEE ALSO ⭐

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

πŸ‘‘ AUTHOR πŸ‘‘

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

Copyright (c) 2012 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.

⚠️ real talk: that license paragraph is not a vibe, it's a legal requirement. read LICENSE and DISCLAIMER.txt, bestie. it's giving "adult responsibilities". πŸ“

and that's the whole page!! this was perl v5.38.2, dated 2024-08-10, and it's the VM::EC...achment(3pm) page β€” tysm for reading, mwah, go attach something responsibly πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from