An Elastic IP address, also known as EIP is a static IPv4 address, which can be assigned to an EC2 instance. The Elastic IP address is generally used for covering the failure of an EC2 Instance by quickly remapping it to another EC2 instance. An Elastic IP address is allocated to an AWS account and can only be used in a specific region. That is, we cannot associate an Elastic IP address allocated in one region to an EC2 instance in a different region.
Creating and assigning Elastic IPs
How to do it...
We can allocate and associate an Elastic IP address with an EC2 instance using an ec2_ip module. This will require the instance ID of the EC2 instance we want to associate this Elastic IP address with and the region of that instance...