Hello everyone, In this article, I will be discussing the Elastic IP service offered by AWS under the EC2 section.
Firstly, I will give you a detailed overview of the service, then I will move on to the implementation of the service.
Those who do not want to read the overview and want to move on directly to the Implementation part. Click here.
An Elastic IP address is a static IPv4 address designed for dynamic
By static, it means that the IPV4 address means it does not change over time.
An Elastic IP address is allocated to your AWS account and is yours until
you release it.
- By using an Elastic IP address you can quickly sort out the issue of an Instance failure, by quickly releasing & attaching the Elastic IP address to another Instance hosted with the same application.
- In case your instance or network interface does not have a Public IPV4 address, you can assign an Elastic IP address to it, to make it publicly reachable.
- As you know the IPV4 address of Instance changes whenever you reboot it. So to avoid that, we can associate the Elastic IP address to our Instance. Now the Public IP address of our instance will not change on reboot. (This is the case for which I use the Elastic IP Address most).
- AWS currently does not support Elastic IP addresses for IPv6.
- By default, all AWS accounts are limited to five (5) Elastic IP addresses per Region, because public (IPv4) internet addresses are a scarce public resource. If you think your architecture warrants additional Elastic IP addresses, you can request a quota increase directly from the Service Quotas console.
Elastic IP Pricing
- If the Elastic IP Address is not associated with any running instance or it is associated with a stopped instance or unattached network interface, then the AWS will take an hourly charge. It is to ensure the efficient use of Elastic IP Addresses. (This is the real thing to remember when using Elastic IP. I myself had to pay the charges sometime for the Elastic IP Address).
- If your Elastic IP Address is associated with a running instance, then no charge will be taken. It will be totally free.
- But if you attach more than one Elastic IP to an instance, you will be charged.
Creating Elastic IP Address
- Firstly open your EC2 Dashboard. Just follow the images below if you cannot find Elastic IP.
2. When your Elastic IP dashboard opens. I will look something like this.
Click on the "Allocate Elastic IP address" button to create a new Elastic IP address for your account.
3. The Allocate page will look something like this. You can just leave it to all default and click on the "Allocate" button.
This will create an Elastic IP address in your AWS Account.
Associating Elastic IP address to an EC2 Instance
1. Now to associate this newly generated Elastic IP address click on the "Actions" button as marked above.
On clicking the button you will see a menu with the "Associate Elastic IP address" option in it. So just click on the "Associate Elastic IP address" button to proceed.
2. Now a form will open where you have to select the instance or network interface to which you wanted to associate this Elastic IP address.
Just follow the below images to associate the Elastic IP address. But proceeding you must know your instance ID.
Now to verify, just go to the instance detail & check the Public IPV4 address of the instance.
Releasing the Elastic IP Address
To release the Elastic IP Address just follow the images below after selecting your Elastic IP address.
This will release the Elastic IPV4 address from your account.
So that's all for this article. I tried to cover all the important things in this article. But if you wanted to know more in detail. Just go to the official documentation of AWS Elastic IP.
I hope you have found this article informative. If this article helped you in any way, then do subscribe to the blog for more such articles.