When you decide to assign a static IP address to an EC2 instance it is important to understand how the underlying host assignment will work. Let’s say I have an instance with the EC2 host name of ec2-1-2-3-4.compute-1.amazonaws.com and in my pool of allocated addresses I have 50.60.70.80. If I assign that IP address to the instance then the EC2 host name will change to ec2-50-60-70-80.compute-1.amazonaws.com. From this we can assume that the instance has been moved from the original host to the new host. That’s how EC2 handles IP address assignment. The potential issue behind this arises if you use CNAME records to refer to the original host. Those CNAME records will no longer work because they point to the original host. This problem becomes even more evident when you disassociate an IP address from a host. If you are using CNAME records to point to the the ec2 address you will have to modify them.
The best way to handle all of this would be to set up an automated system that can automatically change a CNAME record if the host name changes. This has the added benefit of being able to gracefully handle recovery. You can also do it by hand. In any case make sure that CNAME record TTLs are low so that when a change does need to occur, caching DNS servers don’t hold onto your old records for too long.
