- Elastic or static IP is used if you want your Public IP to be consistent.
- Elastic IP will not be changed, in case the instance will be stopped/started or rebooted.
Steps for creating Elastic IP on Amazon EC2
- Under EC2 Dashboard, go to “Network and Security” and click on the “Elastic IPs” menu item.
- On this page, you will see a list of already created Elastic IPs.
- For creating a new one, click on the button “Allocate Elastic IP address”.
- You will see Elastic IP address settings, where IP will be allocated from amazon’s pool of IPv4 addresses.
- Once created, associate the newly created Elastic IP to your instance.
Steps for associating an IP address to the EC2 instance
- Choose the Elastic IP and select the “Actions” button.
- Under the Actions button, there is an option “Associate Elastic IP address” and select this option.
- On the next step, choose which instance you want to associate this IP with and click the “Associate” button.
- You will see a success alert “Elastic IP address associated with respective IP”
- Now if you go to that Instance detail, you will see newly Elastic IP will be displayed under “Elastic IPs” and “IPv4 Public IP” headings.
- If you start/stop or reboot this instance, the Elastic IP will remain the same.
Remove/delete Elastic IP
- Firstly, you need to Disaccociate the Elastic IP from the linked instance, by clicking on the “Disassociate Elastic IP address” under the “Actions” button.
- After that, click on “Release Elastic IP addresses” option