If you allocate an Elastic IP address in the US-East region (N.Virginia), then sorry folks but you can’t use this IP address with an EC2 instance which is located in another region, say EU-West (Ireland) for example.
No problem to remap it to an EC2 instance in another availability zone within the same region.
The documentation of Amazon EC2 leaves another impression:
Elastic IP addresses allow you to mask instance or Availability Zone failures by programmatically remapping your public IP addresses to any instance in your account.
This is a bit misleading. I already had started dreaming as how I can transfer my EC2 instance across continents with no DNS propagation issues. And also had started admiring Amazon as to how they achieved this technically… Well, they haven’t. 🙂
References:
March 20, 2015 at 11:39 am
This would be possible if we gained elastic anycast IPs. But one can dream…
March 20, 2015 at 6:32 pm
Standard anycast IPs are a bit tricky for stateful connections like TCP. If Amazon were to provide such a thing as an anycast Elastic IP, they’d need to route internally using dedicated fiber links, which may be viable on the same continent but it won’t be cheap.
March 23, 2015 at 1:07 am
You could create hostnames in route 53 and use that as the endpoint. then if you need to move to another region just update the the ip address in the hosted zone.
March 23, 2015 at 10:05 pm
Yeap, that’s the solution. The problem is that you never know for how long the clients cache your old DNS record. They should obey the TTL of your DNS server but sometimes they don’t. A few years back I’ve tested this and even though the TTL was 5 minutes, more than 4 hours after we changed the DNS records there were still requests going to the old IP address. I haven’t tested this recently though – things may have changed signifficantly.