Elastic IP vs Public IP: What It Is and When toUse It

Definition

In Amazon Web Services (AWS), a Public IP address is a dynamic IPv4 address automatically assigned to an Amazon EC2 instance from Amazon's pool, enabling it to connect to the internet. An Elastic IP (EIP) address is a static, public IPv4 address that you allocate to your AWS account and can associate with an EC2 instance or network interface, providing a persistent endpoint for internet-facing applications.

How It Works

When you launch an EC2 instance into a default Virtual Private Cloud (VPC) or a subnet configured to auto-assign public IPs, it receives a Public IP address from a pool owned by AWS. This IP address is mapped to the instance's primary private IP address through Network Address Translation (NAT), typically via an Internet Gateway attached to the VPC.

Key behaviors of a standard Public IP:

  • Dynamic Allocation: The specific IP address is assigned at instance launch and cannot be chosen beforehand.
  • Lifecycle: A Public IP is associated with the instance for its lifetime. However, if you stop and then start the instance, it will be assigned a new Public IP address. The original IP is released back into Amazon's pool and is lost.
  • Dissociation: When the instance is terminated, the Public IP is permanently released.

An Elastic IP (EIP) address offers a more stable and controllable alternative. You first allocate an EIP to your AWS account within a specific region. It remains in your account, independent of any single EC2 instance, until you explicitly release it. Once allocated, you can associate this static IP with an EC2 instance or a network interface in your VPC.

Key behaviors of an Elastic IP:

  • Static Allocation: The IP address is allocated to your account and remains yours until you release it.
  • Persistence: The EIP remains associated with your instance even if you stop and restart it.
  • Remapping: You can quickly remap an EIP from one instance to another. This is a key feature for implementing failover scenarios; if one instance fails, you can re-associate the EIP with a healthy replacement instance, redirecting traffic with minimal downtime and without needing DNS changes.

When an EIP is associated with an instance's primary network interface, it replaces the existing dynamic Public IP, which is then released back to the AWS pool.

Key Features and Limits

Elastic IP Addresses:

  • Static & Persistent: EIPs provide a fixed public IPv4 address that does not change when an instance is stopped or restarted.
  • Account-Level Resource: EIPs are allocated to your AWS account in a specific region and exist independently of any EC2 instance.
  • Remappable: An EIP can be quickly associated with a different EC2 instance or network interface, facilitating rapid failover.
  • Service Quota: By default, each AWS account is limited to 5 Elastic IP addresses per region. This is a soft limit that can be increased by submitting a request to AWS Support.
  • Regional Scope: An EIP can only be used in the AWS region where it was allocated.
  • Reverse DNS: You can configure reverse DNS records for your EIPs, which is often a requirement for email servers.
  • Bring Your Own IP (BYOIP): You can bring your own public IPv4 address ranges to AWS and use them as Elastic IPs.

Public IP Addresses:

  • Dynamic: Automatically assigned at launch and changes if the instance is stopped and started.
  • Transient: The IP address is tied to the lifecycle of a specific instance run. When the instance is terminated, the IP is lost.
  • No Direct Control: You cannot move a dynamic Public IP from one instance to another.
  • Default Behavior: Instances launched in a default VPC or a public subnet with the auto-assign setting enabled will receive a Public IP by default.

Common Use Cases

Use an Elastic IP when:

  1. Hosting a Public-Facing Server: For web servers, mail servers, or any application that needs a stable, predictable IP address that clients and DNS records can point to consistently.
  2. Implementing High Availability and Failover: In a failure scenario, you can remap the EIP to a standby instance, quickly restoring service without waiting for DNS propagation.
  3. Whitelisting IP Addresses: When you need to provide a static IP address to a third party for them to add to a firewall allow-list for API access or other secure communications.
  4. Running a NAT Gateway: A Network Address Translation (NAT) Gateway in a public subnet requires an Elastic IP to provide internet access to instances in private subnets.

Use a dynamic Public IP when:

  1. Temporary or Non-Critical Workloads: For short-lived instances, development/test environments, or batch processing jobs that need to pull data from the internet but do not require a persistent inbound endpoint.
  2. Cost-Sensitive Applications with DNS: If you can rely on a DNS service like Amazon Route 53 to manage a hostname, the dynamic nature of the IP may be acceptable. The application can register its new IP with the DNS service upon startup.
  3. Outbound-Only Communication: For instances that primarily initiate outbound connections to the internet and do not host services that require a stable IP address for inbound connections.

Pricing Model

As of February 1, 2024, AWS charges for all public IPv4 addresses, including both Elastic IPs and dynamic Public IPs.

  • In-Use and Idle Charges: AWS charges an hourly fee for every public IPv4 address allocated to your account. The rate is $0.005 per IP per hour, regardless of whether the IP is associated with a running resource or is sitting idle in your account.
  • Free Tier: The AWS Free Tier for Amazon EC2 includes 750 hours of public IPv4 address usage per month.
  • No Charge for BYOIP: There is no charge for using your own IP addresses that you bring to AWS (BYOIP).

This pricing model encourages the efficient use and conservation of scarce public IPv4 addresses. You can monitor your public IP usage and estimate costs using AWS Cost and Usage Reports and the Public IP Insights feature in Amazon VPC IP Address Manager (IPAM).

Pros and Cons

| Feature | Elastic IP (EIP) | Public IP | | :--- | :--- | :--- | | Persistence | Pro: Static and persistent. Survives instance stops, reboots, and terminations (remains in your account). | Con: Dynamic and ephemeral. A new IP is assigned after a stop/start cycle, and it's lost on termination. | | Control | Pro: High control. Can be remapped between instances for failover or infrastructure changes. | Con: No control. You cannot move the IP to another instance. | | Use Cases | Pro: Essential for stable endpoints like web servers, DNS records, and IP whitelisting. | Con: Unsuitable for services requiring a fixed address. Best for temporary or outbound-only needs. | | Cost | Con: Incurs a cost of $0.005/hour per IP, whether in use or idle. | Con: Also incurs a cost of $0.005/hour per IP while the instance is running. | | Limits | Con: Default limit of 5 EIPs per region, which can be a constraint for large deployments. | Pro: No direct limit on the number of dynamic Public IPs you can use, beyond standard EC2 instance limits. |

Comparison with Alternatives

  • Amazon Route 53: Instead of relying on a static IP, you can use a DNS hostname from Route 53. For highly available applications, an Elastic Load Balancer (ELB) is the recommended approach. An ELB provides a stable DNS endpoint and distributes traffic across multiple EC2 instances, removing the need for individual instances to have a public IP at all.
  • AWS Global Accelerator: This service provides two static IP addresses that act as a fixed entry point to your application endpoints (like Load Balancers or EC2 instances) in one or more AWS Regions. It improves performance and availability by routing traffic over the AWS global network.
  • EC2 Instance Connect Endpoint: For secure remote access (SSH/RDP) to instances in private subnets, an EIC Endpoint allows you to connect without requiring the instance to have a public IP, enhancing security.

Exam Relevance

Understanding the difference between Elastic IPs and Public IPs is fundamental for several AWS certifications, particularly:

  • AWS Certified Cloud Practitioner (CLF-C02): Expect basic questions about the definition and purpose of an Elastic IP (a static IP) versus a default Public IP (a dynamic IP).
  • AWS Certified Solutions Architect – Associate (SAA-C03): This exam requires a deeper understanding. You'll need to know when to use an EIP for high availability and fault tolerance (e.g., manual failover), its role with NAT Gateways, and why an Elastic Load Balancer is often a better architectural choice than a single instance with an EIP.
  • AWS Certified SysOps Administrator – Associate (SOA-C02): Focuses on the operational aspects, such as allocating, associating, disassociating, and releasing EIPs, as well as monitoring costs associated with them.

Examinees should clearly know that a Public IP changes on stop/start, while an Elastic IP does not.

Frequently Asked Questions

Q: Does an Elastic IP cost money if it's attached to a running EC2 instance?

A: Yes. As of February 1, 2024, AWS charges for all public IPv4 addresses, including Elastic IPs attached to running instances. The cost is typically $0.005 per IP per hour.

Q: Can I move an Elastic IP to a different AWS Region?

A: No, an Elastic IP address is for use in a specific Region only and cannot be moved to a different one. You must allocate a new EIP in the target region.

Q: What is the difference between stopping and terminating an EC2 instance in relation to its IP address?

A: When you stop an instance, it can be restarted later. If it has a dynamic Public IP, that IP is released and a new one is assigned upon restart. If it has an Elastic IP, it retains that EIP. When you terminate an instance, it is permanently deleted. Both its dynamic Public IP and any associated Elastic IP are disassociated. The dynamic Public IP is lost forever, while the Elastic IP remains allocated to your account until you explicitly release it.


This article reflects AWS features and pricing as of 2026. AWS services evolve rapidly — always verify against the official AWS documentation before making production decisions.

Published: 7/4/2026 / Updated: 7/4/2026

This article is for informational purposes only. AWS services, pricing, and features change frequently — always verify details against the official AWS documentation before making production decisions.

More in Concepts