You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::EC2::ClassicAddress
- Inherits:
-
Resources::Resource
- Object
- Resources::Resource
- Aws::EC2::ClassicAddress
- Defined in:
- (unknown)
Instance Attribute Summary collapse
-
#allocation_id ⇒ String
readonly
The ID representing the allocation of the address for use with EC2-VPC.
-
#association_id ⇒ String
readonly
The ID representing the association of the address with an instance in a VPC.
-
#carrier_ip ⇒ String
readonly
The carrier IP address associated.
-
#customer_owned_ip ⇒ String
readonly
The customer-owned IP address.
-
#customer_owned_ipv_4_pool ⇒ String
readonly
The ID of the customer-owned address pool.
-
#domain ⇒ String
readonly
Indicates whether this Elastic IP address is for use with instances in EC2-Classic (
standard
) or instances in a VPC (vpc
). -
#instance_id ⇒ String
readonly
The ID of the instance that the address is associated with (if any).
-
#network_border_group ⇒ String
readonly
The name of the unique set of Availability Zones, Local Zones, or Wavelength Zones from which AWS advertises IP addresses.
-
#network_interface_id ⇒ String
readonly
The ID of the network interface.
-
#network_interface_owner_id ⇒ String
readonly
The ID of the AWS account that owns the network interface.
-
#private_ip_address ⇒ String
readonly
The private IP address associated with the Elastic IP address.
-
#public_ip ⇒ String
readonly
-
#public_ipv_4_pool ⇒ String
readonly
The ID of an address pool.
-
#tags ⇒ Array<Types::Tag>
readonly
Any tags assigned to the Elastic IP address.
Attributes inherited from Resources::Resource
Instance Method Summary collapse
-
#associate(options = {}) ⇒ Types::AssociateAddressResult
Associates an Elastic IP address, or carrier IP address (for instances that are in subnets in Wavelength Zones) with an instance or a network interface.
-
#disassociate(options = {}) ⇒ Struct
Disassociates an Elastic IP address from the instance or network interface it's associated with.
An Elastic IP address is for use in either the EC2-Classic platform or in a VPC.
-
#initialize ⇒ Object
constructor
-
#release(options = {}) ⇒ Struct
Releases the specified Elastic IP address.
[EC2-Classic, default VPC] Releasing an Elastic IP address automatically disassociates it from any instance that it's associated with.
Methods inherited from Resources::Resource
add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until
Methods included from Resources::OperationMethods
#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations
Constructor Details
#initialize(public_ip, options = {}) ⇒ Object #initialize(options = {}) ⇒ Object
Instance Attribute Details
#allocation_id ⇒ String (readonly)
The ID representing the allocation of the address for use with EC2-VPC.
#association_id ⇒ String (readonly)
The ID representing the association of the address with an instance in a VPC.
#carrier_ip ⇒ String (readonly)
The carrier IP address associated. This option is only available for network interfaces which reside in a subnet in a Wavelength Zone (for example an EC2 instance).
#customer_owned_ip ⇒ String (readonly)
The customer-owned IP address.
#customer_owned_ipv_4_pool ⇒ String (readonly)
The ID of the customer-owned address pool.
#domain ⇒ String (readonly)
Indicates whether this Elastic IP address is for use with instances in
EC2-Classic (standard
) or instances in a VPC (vpc
).
Possible values:
- vpc
- standard
#instance_id ⇒ String (readonly)
The ID of the instance that the address is associated with (if any).
#network_border_group ⇒ String (readonly)
The name of the unique set of Availability Zones, Local Zones, or Wavelength Zones from which AWS advertises IP addresses.
#network_interface_id ⇒ String (readonly)
The ID of the network interface.
#network_interface_owner_id ⇒ String (readonly)
The ID of the AWS account that owns the network interface.
#private_ip_address ⇒ String (readonly)
The private IP address associated with the Elastic IP address.
#public_ip ⇒ String (readonly)
#public_ipv_4_pool ⇒ String (readonly)
The ID of an address pool.
#tags ⇒ Array<Types::Tag> (readonly)
Any tags assigned to the Elastic IP address.
Instance Method Details
#associate(options = {}) ⇒ Types::AssociateAddressResult
Associates an Elastic IP address, or carrier IP address (for instances that are in subnets in Wavelength Zones) with an instance or a network interface. Before you can use an Elastic IP address, you must allocate it to your account.
An Elastic IP address is for use in either the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide.
[EC2-Classic, VPC in an EC2-VPC-only account] If the Elastic IP address is already associated with a different instance, it is disassociated from that instance and associated with the specified instance. If you associate an Elastic IP address with an instance that has an existing Elastic IP address, the existing address is disassociated from the instance, but remains allocated to your account.
[VPC in an EC2-Classic account] If you don't specify a private IP address, the Elastic IP address is associated with the primary IP address. If the Elastic IP address is already associated with a different instance or a network interface, you get an error unless you allow reassociation. You cannot associate an Elastic IP address with an instance or network interface that has an existing Elastic IP address.
[Subnets in Wavelength Zones] You can associate an IP address from the telecommunication carrier to the instance or network interface.
You cannot associate an Elastic IP address with an interface in a different network border group.
This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error, and you may be charged for each time the Elastic IP address is remapped to the same instance. For more information, see the Elastic IP Addresses section of Amazon EC2 Pricing.
#disassociate(options = {}) ⇒ Struct
Disassociates an Elastic IP address from the instance or network interface it's associated with.
An Elastic IP address is for use in either the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide.
This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error.
#release(options = {}) ⇒ Struct
Releases the specified Elastic IP address.
[EC2-Classic, default VPC] Releasing an Elastic IP address automatically disassociates it from any instance that it's associated with. To disassociate an Elastic IP address without releasing it, use DisassociateAddress.
[Nondefault VPC] You must use DisassociateAddress to disassociate the Elastic IP address before you can release it. Otherwise, Amazon EC2 returns an error (InvalidIPAddress.InUse
).
After releasing an Elastic IP address, it is released to the IP address pool. Be sure to update your DNS records and any servers or devices that communicate with the address. If you attempt to release an Elastic IP address that you already released, you'll get an AuthFailure
error if the address is already allocated to another AWS account.
[EC2-VPC] After you release an Elastic IP address for use in a VPC, you might be able to recover it. For more information, see AllocateAddress.