Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible to associate Elastic IP to an instance without immediately losing public ip?

I have a windows EC2 instance running a production website and DNS is configured to have my domain name point to its public IP. There is currently no Elastic IP (EIP) associated with the instance. I would like to start using a Elastic IP and have my domain name point to it instead of the public IP (which can change if I ever have to change the instance).

Reading the documentation I find this statement troubling:

When you associate an EIP with an instance, the instance's current public IP address is released to the EC2-Classic public IP address pool.

My fear is this:

  • I assign an EIP to the instance and the public IP is released.
  • Now my website no longer works, because the domain name points to the public IP, which is no longer associated with my EC2 instance.
  • I must then point DNS records to the EIP. But this could take up to 48 hours for propagation to take place (i.e. my site may be be unreachable for up to 48 hours).

How can I do this without having to live through DNS propagation?

like image 320
M Schenkel Avatar asked Oct 25 '25 20:10

M Schenkel


1 Answers

48 to 72 hours before your pre-determined switch-over time, reduce the time-to-live (TTL) on your DNS entry to 300 seconds (5 minutes).

At your designated switch-over time:

  1. Attach the Elastic IP address
  2. Update your DNS entry to point to your Elastic IP address

Doing this, your effective "downtime" is reduced to 5 minutes.

like image 172
Matt Houser Avatar answered Oct 28 '25 14:10

Matt Houser