How to Assign an Elastic IP address to your EC2 Instance in AWS. In this guide you are going to learn the importance and necessary of Elastic IP address and how to assign it to your EC2 Instance.
The Elastic IP should be assigned to an instance, if it is not assigned you may incurr additional billing for idle time usage. So if you have any unassigned Elastic IP address, make sure to remove them.
Once you create a new EC2 Instance your instance will get a new public IP address. But this IP address is not static so it will change or a new IP will get assigned to your instance when certain actions are made on your instance like restarting your instance.
If you have your public IP address configured in your DNS A record, that particular IP address can change anytime. So when a new IP address is assigned to your instance your visitor cannot see your website because it points to the old IP address which you don’t have control anymore.
To overcome this issue Elastic IP comes in which is a static IPv4 address designed for dynamic cloud computing. With the Elastic IP you can rapidly remap the address to any instance in your account.
- A running EC2 Instance. Learn how to create an AWS EC2 instance.
Create Elastic IP address
Login to your AWS management console and navigate to Compute >> EC2 and under Network and security click Elastic IPs.
In this screen click Allocate Elastic IP address.
Now a new IPv4 address will get allocated.
Associate Elastic IP address
Once an IP is allocated you need to associate it with the EC2 Instance.
To do so check the checkbox of your IP address and click Actions and choose Associate Elastic IP address.
In the Resource type choose Instance and and choose the instance from the dropdown on the Instance field.
If you have any other Elastic IP address assigned before and you need to re-associate you can enable the checkbox in Reassociation
Release Elastic IP address
If you wish to no longer use the allocated IP address you can release it to prevent any unnecessary billings.
To do so check the checkbox of your IP address and click Actions and choose Release Elastic IP address.
Become a Certified AWS Professional with this easy to learn course now.
Now you have learned how to allocate, associate and release Elastic IP address AWS.
Thanks for your time. If you face any problem or any feedback, please leave a comment below.