AWS Elastic IPs are a feature of the AWS cloud platform that allow you to assign a unique IP address to each instance in your account. This allows you to easily manage and scale your applications by assigning different instances different IP addresses. Elastic IPs are particularly useful for applications that require high availability or scalability. By assigning a unique IP address to each instance, you can ensure that each application is running on its own dedicated server, eliminating the possibility of one instance crashing affecting the performance of other instances. Additionally, Elastic IPs make it easy to move your applications between different AWS regions without having to reconfigure them or lose data. Simply change the IP address for an instance and all traffic will continue flowing smoothly. ..


AWS Elastic IPs are permanently reserved IP addresses that you can associate with a running EC2 instance, and that persist across reboots and even server changes, so you won’t have to change your DNS whenever your server restarts.

What Are Elastic IPs? How Much Do They Cost?

AWS can’t assign a static reserved IP address to every running EC2 instance. Instead, the machine’s public IP address is, by default, temporary. When you turn the machine off, that address is available for others to use, and you won’t have the same IP when you turn it back on.

This can be a problem, because if you link your domain name to the public IP, your domain name will break whenever you restart your server. You shouldn’t have to change your DNS on every restart, so the solution is an Elastic IP address, which never changes.

When you can associate the Elastic IP to a machine, the public IP for that machine is replaced by the Elastic one. The associated address is attached to the instance itself; If the instance turns off, the elastic IP stays where it is, and reattaches to the instance when it turns back on. If you need to upgrade, switch, or replace your server, you can reassociate the address to a new instance, hence Elastic IP. But, it achieves the same effect as having a static IP address for your server.

If you’re using AWS Load Balancers, you won’t want to use Elastic IPs, as your gateway address (the last endpoint before going out to the internet) is be the Load Balancer itself, which has a static hostname (but not a static IP). The load balancer runs on AWS, and you associate it with instances based on their instance IDs, not the public IP address. But, if you’re using an external CDN service like Fastly, you need to use Elastic IPs, as the gateway IP is the EC2 instance’s public IP.

How to Provision an Elastic IP

Elastic IPs are provisioned just like any other AWS service. You can find them in the EC2 Management Console, under the “Elastic IPs” tab:

That’s all that’s required to create an Elastic IP address, but you also need to associate the address with a running instance. Right click the address in the list, and click “Associate Address.” You’ll be asked for the instance ID or network interface of the instance you want to assign the address to.

Associating the Elastic IP will detach the current public IP, so you must switch everything to this new IP.

Working with Elastic IPs from the Command Line

You can allocate a new address with:

Release addresses with:

And, list your currently used addresses with:

If you want to get the allocation ID to associate the address with an instance, pipe it to jq:

And, use the associate-address command to link it:

For further information, you can consult the CLI command reference.