Ec2 instance IP address changed to new ip address

24 views Asked by At

My ec2 ipv4 public ip address changes to new ip address automatically and now when I login it says in console

 POST http://13.211.13.11:8080/login net::ERR_TIMED_OUT then (async)        
(anonymous) @   login.js:5
(anonymous) @   login.js:3
(anonymous) @   loginpage.js:48
(anonymous) @   loginpage.js:37
Show 31 more frames

I changed my util.js in client folder to refer to new ip address however its still referring to old ip address and hence I can't login. is there any way to fix this so I can login to my website rather getting the error it can't find old ip address?

I am using amazon ec2 instance and rds for this application

1

There are 1 answers

1
John Rotenstein On

The Public IP address assigned to an Amazon EC2 instance will change if the instance is Stopped and Started.

To keep a consistent public IP address, create an Elastic IP address and assign it to the instance. This is a static IP address that will stay with the instance until you dissociate it.