I want to know if I can reserve a number of Amazon Elastic IP addresses and assign them to instances started by Autoscale. So basically, when a new instance is started because a trigger has been triggered can I also set the API to look for a spare IP address and allocate it to the instance. I need to do this because the started instance will need to communicate to a server outside the cloud and get through a firewall which will only allow remote access from a predefined set of IP addresses. So i think i need to reserve some IPs, add them to my firewall settings then allocate them (automatically) when a new instance is started.
Any ideas?
It is possible. First of all though, you only get 5 elastic IP addresses by default, to get more you need to ask Amazon Web Services and explain your use case. Once you have enough:
Use the ec2-describe-addresses command line call. This will spit back what your elastic IP addresses are and what if any instance IDs are bound to them.
Pick an open address, then use ec2-allocate-address to tie the instance to the IP addresses. When you shut down the instance make sure to remove it as well.