Open In App

How To Associate Elastic IP Addresses With Resources In Your VPC ?

Last Updated : 08 Apr, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

It is a public IPv4 address that may be accessed over the internet. One can assign an elastic IP address to the instance to facilitate internet connectivity if it doesn’t have a public IPv4 address.

In other words, a static IPv4 address intended for dynamic cloud computing is called an elastic IP address. The AWS account is assigned an elastic IP address, which is owned by the account until one releases it. One can quickly remap an Elastic IP address to another instance in the account to hide the failure of the software or instance.

Features of Elastic IP

  • It is static, indicating it does not change over time.
  • It is region-specific, which means it can be used only in the region in which it is present and cannot be moved to another region.
  • An elastic IP address originates from either a custom IPv4 address pool that you have added to your AWS account or from the pool of IPv4 addresses offered by Amazon.
  • To use an elastic IP, one has to first allocate it to the account, then proceed and associate it with the instance or the network interface.
  • If you disassociate Elastic IP from any resources, it will remain present in the account until you explicitly release it.
  • If you associate Elastic IP with the instance, it also gets associated with the instance’s primary network interface.
  • If you associate an elastic IP address with a network interface that is attached to an instance, it also gets associated with the instance.
  • If an Elastic IP address is associated with an instance or its primary network interface, the instance’s public IPv4 address (if it was there initially) will get released back into Amazon’s pool of public IPv4 addresses. One cannot regain the public IPv4 address, and one cannot convert a public IPv4 address to an elastic IP address.

Allocation of Elastic IP address

As stated above, it is required to allocate the Elastic IP before using it. Please follow the below-demonstrated steps to allocate an elastic IP address:

Step 1: Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/

Step 2: In the navigation pane, choose Network & Security, Elastic IPs.

Elastic IP

Step 3: Choose “Allocate Elastic IP Address” option.

Allocate Elastic IP Address

Step 4: Fill details requested on Allocate Elastic IP address page like, Network group, Public IPv4 address pool, Tag etc.

Details

Step 5: Choose Allocate. You will receive message saying “Elastic IP address allocated successfully” with IP address.

Elastic IP address allocated successfully

Now you can use this elastic Ip and can associate it to your resources.

Associating Elastic IP address

You can associate the Elastic IP address to the instance or to the network interface. Please find steps below for the steps to associate the Elastic Ip to your resources:

Step 1: Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/

Step 2: In the navigation pane, choose Elastic IPs.

Step 3: Select the Elastic IP address to associate and choose Actions, Associate Elastic IP address.

Select the Elastic IP address to associate

Step 4: On Associate Elastic IP page, fill below details:

  • Choose Resource type(Instance or Network Interface)
  • For instance, choose instance ID or choose network interface.
  • (Optional) For Private IP address, specify a private IP address with which to associate the Elastic IP address.

Choose Resource type

Step 5: Select Associate. This will allocate the elastic IP to your associated resource.

Output: As in above case, we have associated the Elastic IP to the instance, you can see that public IP of the instance is the IP that is the Elastic IP.

Output

Associating Elastic IP address to different resources

To Network Interface

  • Choose network interface in resources section in step 4 mentioned above.

Network Interface

To Instance

  • Choose Instance in resources section in step 4 mentioned above.

To Instance

Elastic IP addresses with resources in your VPC – FAQ’s

Is there any charge for using Elastic IP address?

Yes. AWS charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses.

If elastic IP is released, can we recover it?

Yes, you may recover the released Elastic IP but there are few conditions as given below:

  • You cannot recover an Elastic IP address if it has been allocated to another AWS account, or if it will result in your exceeding your Elastic IP address limit.
  • Tags associated with the Elastic IP can not be recovered.
  • AWS console can not be used to recover the Elastic IP, recover can be done via Amazon EC2 API or a command line tool only.

How many Elastic IP can be present in AWS account.

All AWS accounts have a quota of five (5) Elastic IP addresses per Region, however this limit can be increased to desired value.

Can we transfer Elastic IP to other account?

Yes. Elastic IP can be transferred to another account in same AWS Region.

Is there any charge for transferring the Elastic Ip?

No. There is no charge for transferring Elastic IP addresses.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads