use VM::EC2 ':vpc';
-subnet_id -- ID of the VPC subnet to associate with the network interface (mandatory) -private_ip_address -- The primary private IP address of the network interface, or a reference to an array of private IP addresses. In the latter case, the first element of the array becomes the primary address, and the subsequent ones become secondary addresses. If no private IP address is specified, one will be chosen for you. See below for more information on this parameter. -private_ip_addresses -- Same as -private_ip_address, for readability. -secondary_ip_address_count -- An integer requesting this number of secondary IP addresses to be allocated automatically. If present, cannot provide any secondary addresses explicitly. -description -- Description of this ENI. -security_group_id -- Array reference or scalar containing IDs of the security group(s) to assign to this interface.You can assign multiple IP addresses to the interface explicitly, or by allowing EC2 to choose addresses within the designated subnet automatically. The following examples demonstrate the syntax:
# one primary address, chosen explicitly -private_ip_address => '192.168.0.12' # one primary address and two secondary addresses, chosen explicitly -private_ip_address => ['192.168.0.12','192.168.0.200','192.168.0.201'] # one primary address chosen explicitly, and two secondaries chosen automatically -private_ip_address => ['192.168.0.12','auto','auto'] # one primary address chosen explicitly, and two secondaries chosen automatically (another syntax) -private_ip_address => ['192.168.0.12',2] # one primary address chosen automatically, and two secondaries chosen automatically -private_ip_address => [auto,2]You cannot assign some secondary addresses explicitly and others automatically on the same ENI. If you provide no -private_ip_address parameter at all, then a single private IP address will be chosen for you (the same as -private_ip_address=>'auto'). The return value is a VM::EC2::NetworkInterface object
-network_interface_id A single network interface ID or an arrayref to a list of IDs. -filter A hashref for filtering on tags and other attributes.The list of valid filters can be found at http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeNetworkInterfaces.html.
description -- hashref groupSet -- hashref sourceDestCheck -- hashref attachment -- hashrefThese values can be retrieved more conveniently from the VM::EC2::NetworkInterface object, so there is no attempt to parse the results of this call into Perl objects.
-description -- interface description -security_group_id -- single security group ID or arrayref to a list of group ids -source_dest_check -- boolean; if false enables packets to be forwarded, and is necessary for NAT and other router tasks -delete_on_termination -- [$attachment_id=>$delete_on_termination]; Pass this a two-element array reference consisting of the attachment ID and a boolean indicating whether deleteOnTermination should be enabled for this attachment.
source_dest_check -- Turns on source destination checkingFor consistency with modify_network_interface_attribute, you may specify attribute names with or without a leading dash, and using either under_score or mixedCase naming:
$ec2->reset_network_interface_atribute('eni-12345678' => 'source_dest_check'); $ec2->reset_network_interface_atribute('eni-12345678' => '-source_dest_check'); $ec2->reset_network_interface_atribute('eni-12345678' => sourceDestCheck);
$attachmentId = $ec2->attach_network_interface(-network_interface_id => $id, -instance_id => $id, -device_index => $index)This method attaches a network interface to an instance using the indicated device index. You can use instance and network interface IDs, or VM::EC2::Instance and VM::EC2::NetworkInterface objects. You may use an integer for -device_index, or use the strings "eth0", "eth1" etc. Required arguments:
-network_interface_id ID of the network interface to attach. -instance_id ID of the instance to attach the interface to. -device_index Network device number to use (e.g. 0 for eth0).On success, this method returns the attachmentId of the new attachment (not a VM::EC2::NetworkInterface::Attachment object, due to an AWS API inconsistency). Note that it may be more convenient to attach and detach network interfaces via methods in the VM::EC2::Instance and VM::EC2::NetworkInterface objects: