1VM::EC2::REST::elastic_UnseetrwoCrokn_tirnitbeurtVfeMad:c:ePE(eC3r2)l::DRoEcSuTm:e:netlaatsitoinc_network_interface(3)
2
3
4
7 use VM::EC2 ':vpc';
8
10 These methods create and manage Elastic Network Interfaces (ENI). Once
11 created, an ENI can be attached to instances and/or be associated with
12 a public IP address. ENIs can only be used in conjunction with VPC
13 instances.
14
15 Implemented:
16 AttachNetworkInterface
17 CreateNetworkInterface
18 DeleteNetworkInterface
19 DescribeNetworkInterfaceAttribute
20 DescribeNetworkInterfaces
21 DetachNetworkInterface
22 ModifyNetworkInterfaceAttribute
23 ResetNetworkInterfaceAttribute
24
25 Unimplemented:
26 (none)
27
28 $interface = $ec2->create_network_interface($subnet_id)
29 $interface = $ec2->create_network_interface(%args)
30 This method creates an elastic network interface (ENI). If only a
31 single argument is provided, it is treated as the ID of the VPC subnet
32 to associate with the ENI. If multiple arguments are provided, they are
33 treated as -arg=>value parameter pairs.
34
35 Arguments:
36
37 The -subnet_id argument is mandatory. Others are optional.
38
39 -subnet_id -- ID of the VPC subnet to associate with the network
40 interface (mandatory)
41
42 -private_ip_address -- The primary private IP address of the network interface,
43 or a reference to an array of private IP addresses. In the
44 latter case, the first element of the array becomes the
45 primary address, and the subsequent ones become secondary
46 addresses. If no private IP address is specified, one will
47 be chosen for you. See below for more information on this
48 parameter.
49
50 -private_ip_addresses -- Same as -private_ip_address, for readability.
51
52 -secondary_ip_address_count -- An integer requesting this number of secondary IP
53 addresses to be allocated automatically. If present,
54 cannot provide any secondary addresses explicitly.
55
56 -description -- Description of this ENI.
57
58 -security_group_id -- Array reference or scalar containing IDs of the security
59 group(s) to assign to this interface.
60
61 You can assign multiple IP addresses to the interface explicitly, or by
62 allowing EC2 to choose addresses within the designated subnet
63 automatically. The following examples demonstrate the syntax:
64
65 # one primary address, chosen explicitly
66 -private_ip_address => '192.168.0.12'
67
68 # one primary address and two secondary addresses, chosen explicitly
69 -private_ip_address => ['192.168.0.12','192.168.0.200','192.168.0.201']
70
71 # one primary address chosen explicitly, and two secondaries chosen automatically
72 -private_ip_address => ['192.168.0.12','auto','auto']
73
74 # one primary address chosen explicitly, and two secondaries chosen automatically (another syntax)
75 -private_ip_address => ['192.168.0.12',2]
76
77 # one primary address chosen automatically, and two secondaries chosen automatically
78 -private_ip_address => [auto,2]
79
80 You cannot assign some secondary addresses explicitly and others
81 automatically on the same ENI. If you provide no -private_ip_address
82 parameter at all, then a single private IP address will be chosen for
83 you (the same as -private_ip_address=>'auto').
84
85 The return value is a VM::EC2::NetworkInterface object
86
87 $result = $ec2->delete_network_interface($network_interface_id);
88 $result = $ec2->delete_network_interface(-network_interface_id => $id);
89 Deletes the specified network interface. Returns a boolean indicating
90 success of the delete operation.
91
92 @ifs = $ec2->describe_network_interfaces(@interface_ids)
93 @ifs = $ec2->describe_network_interfaces(\%filters)
94 @ifs =
95 $ec2->describe_network_interfaces(-network_interface_id=>\@interface_ids,-filter=>\%filters)
96 Return a list of elastic network interfaces as
97 VM::EC2::VPC::NetworkInterface objects. You may restrict the list by
98 passing a list of network interface IDs, a hashref of filters or by
99 using the full named-parameter form.
100
101 Optional arguments:
102
103 -network_interface_id A single network interface ID or an arrayref to
104 a list of IDs.
105
106 -filter A hashref for filtering on tags and other attributes.
107
108 The list of valid filters can be found at
109 http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeNetworkInterfaces.html.
110
111 @data = $ec2->describe_network_interface_attribute($network_id,$attribute)
112 This method returns network interface attributes. Only one attribute
113 can be retrieved at a time. The following is the list of attributes
114 that can be retrieved:
115
116 description -- hashref
117 groupSet -- hashref
118 sourceDestCheck -- hashref
119 attachment -- hashref
120
121 These values can be retrieved more conveniently from the
122 VM::EC2::NetworkInterface object, so there is no attempt to parse the
123 results of this call into Perl objects.
124
125 $boolean =
126 $ec2->modify_network_interface_attribute($interface_id,-$attribute_name=>$value)
127 This method changes network interface attributes. Only one attribute
128 can be set per call The following is the list of attributes that can be
129 set:
130
131 -description -- interface description
132 -security_group_id -- single security group ID or arrayref to a list of group ids
133 -source_dest_check -- boolean; if false enables packets to be forwarded, and is necessary
134 for NAT and other router tasks
135 -delete_on_termination -- [$attachment_id=>$delete_on_termination]; Pass this a two-element
136 array reference consisting of the attachment ID and a boolean
137 indicating whether deleteOnTermination should be enabled for
138 this attachment.
139
140 $boolean = $ec2->reset_network_interface_attribute($interface_id =>
141 $attribute_name)
142 This method resets the named network interface attribute to its default
143 value. Only one attribute can be reset per call. The AWS documentation
144 is not completely clear on this point, but it appears that the only
145 attribute that can be reset using this method is:
146
147 source_dest_check -- Turns on source destination checking
148
149 For consistency with modify_network_interface_attribute, you may
150 specify attribute names with or without a leading dash, and using
151 either under_score or mixedCase naming:
152
153 $ec2->reset_network_interface_atribute('eni-12345678' => 'source_dest_check');
154 $ec2->reset_network_interface_atribute('eni-12345678' => '-source_dest_check');
155 $ec2->reset_network_interface_atribute('eni-12345678' => sourceDestCheck);
156
157 $attachmentId =
158 $ec2->attach_network_interface($network_interface_id,$instance_id,$device_index)
159 $attachmentId = $ec2->attach_network_interface(-network_interface_id =>
160 $id, -instance_id => $id, -device_index => $index)
161 This method attaches a network interface to an instance using the
162 indicated device index. You can use instance and network interface IDs,
163 or VM::EC2::Instance and VM::EC2::NetworkInterface objects. You may use
164 an integer for -device_index, or use the strings "eth0", "eth1" etc.
165
166 Required arguments:
167
168 -network_interface_id ID of the network interface to attach.
169 -instance_id ID of the instance to attach the interface to.
170 -device_index Network device number to use (e.g. 0 for eth0).
171
172 On success, this method returns the attachmentId of the new attachment
173 (not a VM::EC2::NetworkInterface::Attachment object, due to an AWS API
174 inconsistency).
175
176 Note that it may be more convenient to attach and detach network
177 interfaces via methods in the VM::EC2::Instance and
178 VM::EC2::NetworkInterface objects:
179
180 $instance->attach_network_interface($interface=>'eth0');
181 $interface->attach($instance=>'eth0');
182
183 $boolean = $ec2->detach_network_interface($attachment_id [,$force])
184 This method detaches a network interface from an instance. Both the
185 network interface and instance are specified using their attachmentId.
186 If the $force flag is present, and true, then the detachment will be
187 forced even if the interface is in use.
188
189 Note that it may be more convenient to attach and detach network
190 interfaces via methods in the VM::EC2::Instance and
191 VM::EC2::NetworkInterface objects:
192
193 $instance->detach_network_interface($interface);
194 $interface->detach();
195
197 VM::EC2
198
200 Lincoln Stein <lincoln.stein@gmail.com>.
201
202 Copyright (c) 2011 Ontario Institute for Cancer Research
203
204 This package and its accompanying libraries is free software; you can
205 redistribute it and/or modify it under the terms of the GPL (either
206 version 1, or at your option, any later version) or the Artistic
207 License 2.0. Refer to LICENSE for the full license text. In addition,
208 please see DISCLAIMER.txt for disclaimers of warranty.
209
210
211
212perl v5.30.0 20V1M9:-:0E7C-22:6:REST::elastic_network_interface(3)