Skip to main content
This lesson explains AWS Elastic IP addresses: what problems they solve, how they work, pricing considerations, and key limitations. It covers the workflow for allocating and associating Elastic IPs and includes CLI examples for common operations.

Why Elastic IPs exist

When you launch an EC2 instance into a public subnet, AWS assigns a public IPv4 address from Amazon’s pool (for example, 1.1.1.1). That automatically assigned public IP is not reserved for your instance — it can change if the instance stops, starts, or moves to another host. Because these ephemeral public IPs are not persistent, using them for long-lived endpoints results in operational problems: clients, DNS records, or integrations would have to track changing IPs. Elastic IP addresses solve this by giving you a static IPv4 address reserved for your AWS account. You can associate that address with an instance or a specific network interface (ENI), and the public IP remains stable across reboots, stop/start cycles, or instance replacement.
  • Allocate an Elastic IP to your AWS account.
  • Associate the Elastic IP with an EC2 instance or ENI.
  • If you need to perform maintenance or failover, disassociate and re-associate the Elastic IP with another instance — clients keep using the same public IP.
A slide titled "Elastic IPs" showing an AWS Cloud diagram with two servers. Server A has a red error/cross icon, while Server B is shown with an assigned Elastic IP (1.1.1.1).

Practical uses

  • Static public endpoints: keep a fixed IPv4 address for services that require a stable IP (legacy systems, IP allowlists).
  • Simple failover: move the Elastic IP between instances in the same region to redirect traffic immediately.
  • Maintenance: assign an Elastic IP to replacement instances without changing DNS records.

Pricing and charging behavior

AWS pricing is designed to discourage hoarding of public IPv4 addresses. Typical billing behavior is:
Keep in mind: AWS intends Elastic IPs to be used sparingly. If an Elastic IP remains allocated but unused (not associated), you will be billed a small hourly fee until you release it.
A slide titled "Elastic IP Pricing" showing an orange chip graphic with several IP slots (one highlighted green) and an arrowed label that reads "Additional IP charged per hour."

Important limitations and region behavior

  • Region-specific: Elastic IPs are allocated per AWS region. You cannot move an Elastic IP between regions.
  • Source pool: Elastic IPs may be from Amazon’s AWS-owned IPv4 pool or from a custom BYOIP (Bring Your Own IP) pool that you imported.
  • Attachment targets: Elastic IPs attach to instances or ENIs and map to the instance’s private IP address.
  • Account scoped: Elastic IPs are associated with your AWS account; they remain allocated until you release them.
Elastic IPs are region-bound. If you need global static addressing, consider using an AWS-managed service such as Global Accelerator or using Route 53 with health checks and failover — Elastic IPs cannot be moved across regions.
A presentation slide titled "Elastic IPs" showing two colored cards: an orange card labeled "Specific to a region" with a location-pin icon, and a pink card labeled "Amazon's pool of IPv4 addresses" with the AWS logo. A small "© Copyright KodeKloud" appears in the bottom-left.

Quick AWS CLI examples

Allocate an Elastic IP for VPC:
Associate an Elastic IP with an instance (use the AllocationId from allocate-address):
Disassociate an Elastic IP (use the AssociationId from associate-address):
Release an Elastic IP (use the AllocationId):

Summary

  • Default AWS-assigned public IPv4 addresses are ephemeral and can change when an instance is stopped, started, or replaced.
  • Elastic IPs are static IPv4 addresses you allocate to your account and associate with instances or ENIs to maintain a persistent public IP.
  • Elastic IPs are region-specific and can be reassigned between instances in the same region.
  • AWS discourages unused Elastic IPs via small hourly charges when they are allocated but not associated, and for additional IPs attached to the same instance.

Watch Video