Override AWS Auto-assign Public IP settings after instance launch

amazon-web-servicesnetworking

There is a limit to 5 public IP addresses (Elastic IPs) for each AWS Account and I have reached such limit.

Now I have many EC2 instances created without the "Auto-assign Public IP" attribute, which assign a public ip address at start.

This is good because we don't pay and consume valuable resources. On the other hand I cannot access directly via ssh, but only bridging between an instance that has a public ip address.

I would like to override the "Auto-assign Public IP" parameter set during instance launch, in order to restart the instances and allocate a public ip address when need. And, when the maintenance task is completed, reset the parameter and restart the instance again.

Is there any chance to change this behaviour or should assume is not possible?

Best Answer

Rather than doing all this IP address shuffling, consider making all of your instances client on a VPN, each with their own private IP address assigned by you. I think Amazon has something like this in place, but the way I did it was by putting up an instance of the open source Openvpn server ( the Community Edition). My little VPN routed traffic between my home network, office, and cloud-based Windows and Linux instances from 3 different providers. Seamlessly.

Related Topic