Public IP Addresses in AWS Keeps changing!!!

Did you spin up an instance and found that there is no public IP address associated with it?
The solution is simple – at the time of creating an EC2 instance you will have to enable (auto-assign public IP) toggle:

Auto-assign public IP – disabled

Click on the edit button and then select the ‘enable’ option from the drop down and you are good to go:

The second scenario – suppose you forgot to auto-assign the public IP address at the time of launching an EC2 instance then do not worry!
There is a solution – Elastic IP.

Elastic IP is a static IP in AWS which can be allocated and associated after the instance has been created.
It is a public IPv4 address which is reachable from the internet.

It quite easy to allocate and attach it with an EC2 instance, here’s how:
Under the EC2 service > Network & Security > Elastic IPs:

Elastic IP section

Click on the allocate elastic IP address button then select the region and press allocate.
It gets created and the next step is to click on actions drop down and select associate elastic IP address:

A page appears for associating the IP address with an instance you desire:

Fill in the details and press associate button and viola it’s done!

Elastic IP addresses are quite handy – it helps to mitigate the risk of public IP addresses that keeps changing at the time of stopping and starting an EC2 instances.

Hope you find this useful!
Stay tuned for more articles.

Cheers!


Posted

in

by

Tags: