In AWS is there a thing like a private elastic IP address?

Question:

I have an EC2 instance with a stateful service on it (think database). It has an explicitly set VPC-internal IP address which I am using in clients.

Now I would like to re-instance, reboot or otherwise perform maintenance on that instance without clients erroring out. I could spin up a second instance and point all clients to the new IP address, but this way I would still need to synchronise both instances until the last client switches over.

In AWS you can have elastic IP addresses. This allows you to switch the instance an IP is pointing to. Problem is those are public (reachable from the internet). I want a VPC-internal IP address I can re-assign between instances. Is there such a thing in AWS?

Answer:

Yes, you can do it by attaching additional network interface(eth1)to the instance which will be assigned a private IP. During the maintenance of the instance, you can move the network interface to the new instance.

Link:docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html

Leave a Reply