mitchellh/vagrant-aws — pull request #289 by btomasini (2014-09-02 22:33:40+00:00)
Title: Allocate existing Elastic IP address using existing config api

I know there are other Pull Requests accomplishing similar. Feel free to ignore this if it is duplicative.

This implementation does the following:

1. Uses the existing elastic_ip config parameter as a String. If set to an IP address, it will associate an existing Elastic IP address to the instance, raising an error if the address is not available or otherwise fails to be associated. If the value is otherwise truthy, a new Elastic IP address is allocated and associated. This implementation should be backwards compatible with the existing Boolean config approach.
2. If the Elastic IP address is allocated (config value is truthy but not an IP address), the Elastic IP address is released when the instance is terminated. Existing Elastic IP addresses specified as static addresses in the config are not released at termination.
3. This implementation works for both EC2 and VPC instances.