1VM::EC2::NetworkInterfaUcsee(r3)Contributed Perl DocumenVtMa:t:iEoCn2::NetworkInterface(3)
2
3
4

NAME

6       VM::EC2::NetworkInterface - Object describing an Amazon Elastic Network
7       Interface (ENI)
8

SYNOPSIS

10         use VM::EC2;
11         my $ec2 = VM::EC2->new(...);
12         my $interface = $ec2->describe_network_interfaces('eni-12345');
13         print $interface->subNetId,"\n",
14               $interface->description,"\n",
15               $interface->vpcId,"\n",
16               $interface->status,"\n",
17               $interface->privateIpAddress,"\n",
18               $interface->macAddress,"\n";
19

DESCRIPTION

21       This object provides access to information about Amazon Elastic Network
22       Interface objects, which are used in conjunction with virtual private
23       cloud (VPC) instances to create multi-homed web servers, routers,
24       firewalls, and so forth.
25
26       Please see VM::EC2::Generic for methods shared by all VM::EC2 objects.
27

METHODS

29       These object methods are supported:
30
31        networkInterfaceId       -- The ID of this ENI
32        subnetId                 -- The ID of the subnet this ENI belongs to
33        vpcId                    -- The ID of the VPC this ENI belongs to
34        ownerId                  -- Owner of the ENI
35        status                   -- ENI status, one of "available" or "in-use"
36        privateIpAddress         -- Primary private IP address of the ENI
37        privateDnsName           -- Primary private DNS name of the ENI
38                                    as a set of VM::EC2::Group objects.
39        attachment               -- Information about the attachment of this ENI to
40                                    an instance, as a VM::EC2::NetworkInterface::Attachment
41                                    object.
42        association              -- Information about the association of this ENI with
43                                    an elastic public IP address.
44        privateIpAddresses       -- List of private IP addresses assigned to this ENI,
45                                    as a list of VM::EC2::NetworkInterface::PrivateIpAddress
46                                    objects.
47        availabilityZone         -- Availability zone for this ENI as a VM::EC2::AvailabilityZone
48                                    object.
49        macAddress               -- MAC address for this interface.
50
51       In addition, this object supports the following convenience methods:
52
53        resetAttributes()          -- Return attributes to their default states. Currently only
54                                      sets the SourceDestCheck value to true.
55
56        description([$new_value])  -- Description of the ENI. Pass a single argument to set a new
57                                      description
58
59        sourceDestCheck([$boolean])-- Boolean value. If true, prevent this ENI from
60                                      forwarding packets between subnets. Value can optionally
61                                      be set
62
63        security_groups([@new_groups]) -- List of security groups this ENI belongs to. Pass a
64                                      list of new security groups to change this value.
65
66        delete_on_termination([$boolean])
67                                   -- Whether the deleteOnTermination flag is set for the current
68                                      attachment. Pass a boolean value to change the value.
69

Attaching to an instance

71       The following methods allow the interface to be attached to, and
72       detached from, instances.
73
74   $attachment_id = $interface->attach($instance_id => $device)
75   $attachment_id = $interfacee->attach(-instance_id    => $id, -device_index
76       => $device)
77       This method attaches the network interface an instance using the the
78       indicated device index. You can provide either an instance ID, or a
79       VM::EC2::Instance object. You may use an integer for -device_index, or
80       use the strings "eth0", "eth1" etc.
81
82       Required arguments:
83
84        -instance_id          ID of the instance to attach to.
85        -device_index         Network device number to use (e.g. 0 for eth0).
86
87       On success, this method returns the attachmentId of the new attachment
88       (not a VM::EC2::NetworkInterface::Attachment object, due to an AWS API
89       inconsistency).
90
91   $boolean = $interface->detach([$force])
92       This method detaches the network interface from whatever instance it is
93       currently attached to. If a true argument is provided, then the
94       detachment will be forced, even if the interface is in use.
95
96       On success, this method returns a true value.
97

Adding IP addresses

99   $result = $interface->assign_private_ip_addresses(@addresses)
100   $result = $interface->assign_private_ip_addresses(%args)
101       Assign one or more secondary private IP addresses to the network
102       interface. You can either set the addresses explicitly, or provide a
103       count of secondary addresses, and let Amazon select them for you.
104
105       In the list argument form, pass a list of desired IP addresses, or a
106       count of the number of addresses to select for you:
107
108        $interface->assign_private_ip_addresses(3);  # three automatic addresses
109        $interface->assign_private_ip_addresses('192.168.0.10','192.168.0.11');
110
111       Required arguments:
112
113        -private_ip_address      One or more secondary IP addresses, as a scalar string
114        -private_ip_addresses    or array reference. (The two arguments are equivalent).
115
116       Optional arguments:
117
118        -allow_reassignment      If true, allow assignment of an IP address is already in
119                                 use by another network interface or instance.
120
121       The following are valid arguments to -private_ip_address:
122
123        -private_ip_address => '192.168.0.12'                    # single address
124        -private_ip_address => ['192.168.0.12','192.168.0.13]    # multiple addresses
125        -private_ip_address => 3                                 # autoselect three addresses
126
127       The mixed form of address, such as ['192.168.0.12','auto'] is not
128       allowed in this call.
129
130       On success, this method returns true.
131
132   $result = $interface->unassign_private_ip_addresses(@addresses)
133   $result = $interface->unassign_private_ip_addresses(-private_ip_address =>
134       \@addresses)
135       Unassign one or more secondary private IP addresses from the network
136       interface.
137
138       In the list argument form, pass a list of desired IP addresses to
139       unassign.
140
141        $interface->assign_private_ip_addresses('192.168.0.10','192.168.0.11');
142
143       In the named argument form, use:
144
145        -private_ip_address      One or more secondary IP addresses, as a scalar string
146        -private_ip_addresses    or array reference. (The two arguments are equivalent).
147
148       The following are valid arguments to -private_ip_address:
149
150        -private_ip_address => '192.168.0.12'                    # single address
151        -private_ip_address => ['192.168.0.12','192.168.0.13]    # multiple addresses
152
153       On success, this method returns true.
154

STRING OVERLOADING

156       When used in a string context, this object will be interpolated as the
157       networkInterfaceId
158

SEE ALSO

160       VM::EC2 VM::EC2::Generic VM::EC2::NetworkInterface
161       VM::EC2::NetworkInterface::Attachment
162       VM::EC2::NetworkInterface::Association
163

AUTHOR

165       Lincoln Stein <lincoln.stein@gmail.com>.
166
167       Copyright (c) 2012 Ontario Institute for Cancer Research
168
169       This package and its accompanying libraries is free software; you can
170       redistribute it and/or modify it under the terms of the GPL (either
171       version 1, or at your option, any later version) or the Artistic
172       License 2.0.  Refer to LICENSE for the full license text. In addition,
173       please see DISCLAIMER.txt for disclaimers of warranty.
174
175
176
177perl v5.32.1                      2021-01-27      VM::EC2::NetworkInterface(3)
Impressum