0

I have a few servers on EC2 which intercommunicate using a RESTful interface.

Currently, the addresses are saved in a configuration file which lists explicit IPs. This is prone to errors, because it requires the developers to manually change the configuration whenever an instance is replaced.

I thought about a few solutions:

  1. Set an persistent IP for the machines, like Amazon's Elastic IP for external communication. I could not really figure out how to do that, and how to make sure the address does not collide with DHCP-ed addresses given by Amazon.
  2. Add a DNS record in Route 53, with the internal address of the machine (e.g. internal-position-0 -> 172.31.36.145. This is not very elegant, but the change will be only in s single location.
  3. Build an internal DNS server, which requires a lot of maintenance and has all the disadvantages of solution #2.
  4. Add a load balancer (which has a persistent address) just for the sake of routing.

Since these solutions are sub-optimal and this problem must be very common, there is probably some obvious, simple solution that I am missing.

Any ideas how to create a persistent internal IP/DNS record in EC2, so that replacing an instance would not change the internal address associated with the internal service the instance is giving?

3
  • 1
    Use VPC. If you do this, you can specify an IP address on instance creation.
    – EEAA
    Jul 3, 2014 at 14:59
  • @EEAA is absolutely right. General rule: always use VPCs.
    – ceejayoz
    Jul 3, 2014 at 15:01
  • I don't have time to make the above recommendation into a proper answer today. @ceejayoz - if you or someone want to make an answer, by all means feel free.
    – EEAA
    Jul 3, 2014 at 15:23

0

You must log in to answer this question.

Browse other questions tagged .