Why do we need Elastic IP?
When you launch an AWS EC2 instance, AWS automatically allots an IP address to the instance. And this IP address is not static and will change on instance restart.
And if we link this IP address to website domain name, it will work fine as long as we do not restart our instance.
And not restarting instance is not practical, there are situations when we add/edit/delete website feature and that may show-up/function only on instance restart.
And on restart, IP address will change and once the IP address changes the domain name is no more linked to the site.
To overcome this issue, we have to create an Elastic/Static IP for the same.
Elastic IP address is –
- Static and Public IP
- Free to use
- Independent and can be linked to any launched instance
- The linked Elastic IP can even be relinked to different instance at any stage and
- Most importantly, its highly valuable in digital space
Please note: If you create an Elastic IP, you have to use it, make sure to use it else please delete. Every idle IP address will be charged by Amazon. So create one, only when you need one.
STEP1: Create an Elastic IP
- After you login to your AWS account, Click on Services > EC2
- Select ‘Elastic IPs’ from the left navigation column
- Click on ‘Allocate new address’ button
- Once your Elastic IP is created, click on close button
- You will now be back to your Elastic IP section/page
STEP2: Associate Elastic IP to your EC2 instance
- From your Elastic IP page, click on ‘Actions’>’Associate Address’
- Select your instance from instance drop-down and click on ‘Associate’ button.
- Then go back to your EC2 instances list and check ‘IPv4 Public IP’ to cross-check if your new Elastic IP is associated for the same.
- Generally it will be associated, better to cross-check once
STEP3: Link your AWS website Public IP to your domain name
- Login to your domain name provider account
- And only change your ‘A records’ with this new public IP address
Done, don-a-done! All set to go!