# AWS Elastic IP

> An Elastic IP address is a static public IPv4 address that belongs to your AWS account and can be moved between instances or NAT Gateways.

- Source: https://www.itwonderlab.com/aws-elastic-ip/
- Published: 2026-10-05
- Updated: 2026-10-05
- Author: Javier Ruiz Jiménez (https://www.javierruizjimenez.com/)
- Site: IT Wonder Lab (https://www.itwonderlab.com/)

---

![AWS Elastic IP](https://www.itwonderlab.com/media/logos/Others/AWS_EIP.svg)

An **Elastic IP address** (EIP) is a static public IPv4 address that you allocate to your AWS account. Unlike the public IP that an [EC2](https://www.itwonderlab.com/aws-ec2/) instance receives when it starts, which changes when it is stopped and started, an Elastic IP stays yours until you release it.

### Key concepts

- It can be **associated** with an EC2 instance or a network interface, and moved to another one to fail over quickly.
- A [NAT Gateway](https://www.itwonderlab.com/aws-nat-gateway/) needs an Elastic IP: it is the public address that the private [subnets](https://www.itwonderlab.com/aws-subnets/) use to reach the Internet. Allow-lists at third parties can use that fixed address.
- An Elastic IP belongs to a **Region** and to a [VPC](https://www.itwonderlab.com/aws-vpc/) (`domain = "vpc"`).
- For web sites, a [load balancer](https://www.itwonderlab.com/aws-elastic-load-balancing/) with a DNS name in [Route 53](https://www.itwonderlab.com/aws-route-53/) is usually better than an Elastic IP on one instance.

### Pricing

AWS charges for **every public IPv4 address**, whether it is in use or not, so release the Elastic IPs that you do not need. Check the [VPC pricing page](https://aws.amazon.com/vpc/pricing/).

### With Terraform

The resources are `aws_eip` and `aws_eip_association`.

```hcl
resource "aws_eip" "nat" {
  domain = "vpc"
}
```

See tutorials:

-   [AWS with Terraform: The Essential Guide (7/21) – AWS NAT Gateway](https://www.itwonderlab.com/aws-terraform-tutorial-aws-nat-gateway/)
