Prerequisites

Amazon Elastic IPs are EC2 region-specific. You cannot assign an EIP that you created in 'AWS US-East' to an instance in a different region like 'AWS US-West'.

Overview

Amazon's Elastic IP (EIP) addresses allow you to allocate an IP address and assign it to an instance of your choice, which replaces the need for normal dynamic IP addressing in the cloud. Elastic IPs are public IP addresses that you can exclusively reserve from Amazon for your AWS account.

Typically, a public IP address (from Amazon's pool of IP addresses) is randomly assigned to an instance during the boot phase when an instance is launched. Since, new instances are constantly being launched and terminated it's impossible to know which public IP address will be assigned to an instance UNLESS you're using EIPs. Elastic IPs are dynamically remappable IP addresses within the cloud. Therefore, you can configure a server so that it will automatically be assigned and use a public IP address (EIP) that you specify or you can later associate an Elastic IP to a running server. Elastic IPs make it easier to manage servers and make global changes compared to static IPs on traditional hosting solutions. It's also a way of ensuring that you don't 'inherit' traffic from other's servers on EC2, because you're using an IP that's specifically reserved for your usage only, as long as you keep that EIP. See Elastic IP (EIP) for more information.

By default, an account can have a maximum of five Elastic IPs. Amazon charges you $0.01/hr for each unused EIP that you reserve because you're essentially taking away another IP address from Amazon's pool that another person could use for their site. If you want to create more than 5 EIPs, you can submit a request to Amazon at Request to Increase Elastic IP Address Limit. (Typically, you will need two EIPs for each public facing site, so if you expect to use EIPs for more than two sites, you will need to make a request to Amazon to extend your limit.)

Steps

Creating an Elastic IP

Go to Clouds -> AWS Region -> EC2 Elastic IPs. Click the New button.

Note: In the example below,

In a couple of minutes a new Elastic IP address will be added to your account. Refresh your window and you should see the IP address that was just created. Click on the Elastic IPs nickname and change the name to fe1.

Create another EIP and name it fe2. Be sure to write down the IP addresses for the front-end servers because you will need to list them in the next step.

Congratulations! You now have two Elastic IPs that you can associate to an EC2 instance. You can either attach an Elastic IP to instance at boot time or to a running instance. See Elastic IP (EIP) to learn more about the best practices on using EIPs.

Assign Elastic IP at Launch Time

When you launch a server, you will have the choice of assigning an Elastic IP during the add server flow. You may also create a new EIP.

WARNING! Be careful NOT not to steal an EIP from an existing server.

Assign Elastic IP to an Operational Server

Use the Edit action button to assign/reassign an EIP to a running server.