Is it possible to change the IP in ec2 using the server you are on?
What I currently do in the console is:
- Shutdown ec2
- Disassociate the Elastic IP address
- Release the Elastic IP address (so I can create a new one, otherwise, it says max IPs)
- Allocate a new Elastic IP address
- Start up ec2
- Associate the new Elastic IP address to ec2
But, I"m doing this in the console since the ec2 server is being shutdown. Is there a way to do this on the current server I'm using. For example, in pseudocode:
import ec2, boto
ec2.disappociate_current_ip()
ec2.release_ip()
ec2.allocate_new_ip()
ec2.associate_new_ip()