Not able to connect to ec2 instance after associating elastic ip to it and adding proper security group

amazon ec2amazon-elastic-ipamazon-web-services

I have installed wordpress on my ubuntu16.04 LTS instance of ec2. I was able to connect to it via public DNS. But then I added the Elastic IP to the instance and tried to connect to the instance via my browser but it took a lot of time and the browser ended up saying "This site can’t be reached". I have added security group allowing the port 80 as well. Before adding elsatic IP I was accessing the ec2 instance via public dns with no errors. Is this has to do something with elastic IP.

Thanks in advance.

Best Answer

From your question, it looks like you want to connect to your original instance public IP after associating an Elastic IP to it.

That is not possible: as soon as you associate an Elastic IP to your EC2 instance, the old public IP address is released.

See: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html