VM::EC...achment(3pm)
π 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 attachmentinstanceIdβ the ID of the instanceinstanceOwnerIdβ the ID of the owner of the instancedeviceIndexβ the Ethernet device number, like"0"for eth0statusβ always"attached"; more on this below, don't @ meattachmentTimeβ the time this ENI was attached to the instance, as aDateTimedeleteOnTerminationβ 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β theVM::EC2::Instanceto 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::EC2VM::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. readLICENSEandDISCLAIMER.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
- 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