VM::EC2::NetworkInterface::Attachment3pm
Usage
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;}
Overview
This object describes the attachment of a elastic network interface (ENI) to an instance, and allows you to manipulate the attachment.
Please see VM::EC2::Generic for methods shared by all VM::EC2 objects.
Methods
These object methods are supported:
attachmentId -- ID of the attachmentinstanceId -- ID of the instanceinstanceOwnerId -- ID of the owner of the instancedeviceIndex -- Ethernet device number, e.g. "0" for eth0status -- Always "attached"; see below.attachmentTime -- Time this ENI was attached to the instance, as a DateTimedeleteOnTermination -- If true, this ENI will be deleted when the instance terminates.
Amazon does not document the network interface attachment object well, and many of these fields are inferred by inspection of EC2 REST responses. 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.
In addition, this object supports the following convenience methods:
instance -- The VM::EC2::Instance to which the ENI is attached.
String overloading
When used in a string context, this object will be interpolated as the attachmentId.
Releases
6 releases since Debian 8 (Jessie); the text changed 3 times.