When you launch an EC2 instance, you receive a Public IP address by which that instance is reachable. Once you stop that instance and restart that, you get a new Public IP for the same instance’s. So, Public IP get’s changed every time for an instance after stop/start. To solve this problem, we need to attach an Elastic IP to an Instance which doesn’t change after you stop / start the instance as many times.
Create an elastic IP and attach with EC2 instance :
- Click Allocate new address in the Elastic IPs page.
- Then, click Allocate in the next page.
- Go to Actions , and click Associate address.
- Choose the EC2 instance you are integrating and click on Associate button.