I'm trying to find a good way of being able to address my EC2 database instance from both inside and outside of the datacenter. Other EC2 instances need to be able to call into it, and other clients like pgAdmin might need to connect to it from the outside world as well.
It's my understanding that using the internal and external DNS names is sustainable long term as each reboot leads to a change.
I'm thinking of associating an Elastic IP with the instance and giving it an A record (say db1.mydomain.com) which I then will use both within and outside the datacenter. Further instances in the same role will get the same treatment and a DNS record of db2.mydomain.com etc.
Now, is there a cleaner and more stable way of achieving this result? Am going about this the wrong way? Suggestions?