Elastic IP Address: What It Is and When to Use It
Definition
An Amazon EC2 Elastic IP Address (EIP) is a static, public IPv4 address that you can allocate to your AWS account and associate with a resource, such as an EC2 instance or a Network Load Balancer. Unlike a standard public IP address, which can change when an instance is stopped and restarted, an Elastic IP address is persistent and remains associated with your account until you explicitly release it, providing a fixed, reliable endpoint for internet-facing applications.
How It Works
An Elastic IP address is designed for dynamic cloud computing environments. You first allocate an EIP to your AWS account within a specific AWS Region. Once allocated, it's yours to control. You can then associate this EIP with an EC2 instance or a network interface in your Virtual Private Cloud (VPC).
When you associate an EIP with an instance, it replaces the instance's existing public IPv4 address. All internet traffic destined for that EIP is then routed to the associated resource. The key benefit of this design is the ability to rapidly remap the address. If an instance fails, you can disassociate the EIP from the failed instance and reassociate it with a healthy, standby instance in a matter of seconds. This remapping capability allows you to mask instance failures from your users, as they continue to use the same IP address to access your service.
The EIP is technically associated with an Elastic Network Interface (ENI), which is then attached to the EC2 instance. This abstraction allows you to move the entire network identity (including the EIP, private IP, and MAC address) from one instance to another in a single operation.
Key Features and Limits
- Static and Persistent: An EIP remains fixed until you manually release it.
- Regional Scope: Elastic IP addresses are allocated within a specific AWS Region and cannot be moved between Regions.
- IPv4 Only: Elastic IPs are for IPv4 addresses only; AWS does not support Elastic IP addresses for IPv6.
- Remapping Capability: You can quickly move an EIP from one instance or network interface to another within the same account and Region.
- Service Quota: By default, each AWS account is limited to five (5) Elastic IP addresses per Region. This is a soft limit that can be increased by submitting a request to AWS Support.
- Bring Your Own IP (BYOIP): You can bring your own public IPv4 address range to AWS and allocate EIPs from that pool. EIPs allocated from a BYOIP pool do not count against the default service quota.
- Reverse DNS: You can configure a reverse DNS record for your Elastic IP address, which is often a requirement for email servers to avoid being marked as spam.
- Transferability: You can transfer Elastic IPs between different AWS accounts.
Common Use Cases
- High-Availability Websites and Applications: For a critical web server, you can have a standby instance ready. If the primary instance fails, you can remap the EIP to the standby instance, minimizing downtime.
- NAT Gateways: When instances in a private subnet need to initiate outbound traffic to the internet, a NAT (Network Address Translation) Gateway is used. A NAT Gateway requires an Elastic IP address to function, providing a stable source IP for whitelisting by external services.
- Bastion Hosts / Jump Boxes: Administrators often use a single, hardened instance (a bastion host) to access other instances within a VPC. Assigning an EIP to the bastion host provides a consistent IP address that can be whitelisted in security group rules.
- Legacy Systems Requiring IP Whitelisting: When integrating with third-party services that use IP-based security, an EIP provides a predictable public IP address that can be added to their allow lists.
- DNS Management: You can point a custom domain name (e.g.,
api.yourcompany.com) to an Elastic IP address. This ensures that the DNS record doesn't need to be updated if the underlying EC2 instance is replaced.
Pricing Model
As of early 2024, AWS charges for all public IPv4 addresses, including Elastic IP addresses. The pricing structure is as follows:
- In-Use Addresses: There is an hourly charge for any Elastic IP address that is associated with a running AWS resource (like an EC2 instance or NAT Gateway).
- Idle Addresses: A slightly higher hourly charge applies to any Elastic IP address that is allocated to your account but is not associated with a running resource. This is to discourage hoarding of public IPv4 addresses.
Essentially, you are charged for every hour an EIP is allocated to your account, regardless of its association state. The AWS Free Tier includes 750 hours per month of public IPv4 address usage, which is enough to cover one EIP for the entire month. For detailed and current pricing, you should always consult the official Amazon VPC pricing page.
Pros and Cons
Pros:
- High Availability: Enables rapid failover by remapping the IP to a healthy instance.
- Stable Endpoint: Provides a persistent, unchanging public IP address, simplifying DNS management and firewall rules.
- Account-Level Ownership: The IP is tied to your account, not a specific instance, giving you full control over its lifecycle.
- Decouples IP from Instance: Allows you to replace, resize, or perform maintenance on instances without changing the public-facing IP address.
Cons:
- Cost: All public IPv4 addresses, including EIPs, now incur an hourly cost, which can add up, especially for unused (idle) addresses.
- Regional Limitation: EIPs are locked to a specific AWS Region and cannot be used for multi-Region failover. (For this, AWS Global Accelerator is the appropriate service).
- Limited Quota: The default limit of 5 EIPs per region can be restrictive for larger deployments, requiring a service quota increase request.
- Management Overhead: You are responsible for allocating, associating, disassociating, and releasing EIPs. Forgetting to release an unused EIP will result in unnecessary charges.
Comparison with Alternatives
Elastic IP vs. Standard Public IP
- Standard Public IP: Automatically assigned to an EC2 instance from Amazon's pool. It is dynamic and is released back to the pool when the instance is stopped, hibernated, or terminated. You cannot transfer it to another instance.
- Elastic IP: A static IP that you explicitly allocate and control. It persists even when the instance is stopped or terminated and can be remapped to other instances.
Elastic IP vs. Elastic Load Balancer (ELB) / Application Load Balancer (ALB)
- Elastic IP: Provides a static IP for a single resource (like an EC2 instance or NAT Gateway). It is suitable for simple failover or when a single, fixed IP is required.
- Load Balancer: Provides a stable DNS hostname (not a static IP for ALBs) that distributes incoming traffic across multiple backend instances. Load Balancers are generally the preferred, more scalable, and resilient solution for web applications, as they handle health checks and traffic distribution automatically.
Exam Relevance
Elastic IP addresses are a fundamental networking concept and frequently appear on several AWS certification exams, including:
- AWS Certified Cloud Practitioner (CLF-C02): Basic understanding of what an EIP is and why it's used for static addressing.
- AWS Certified Solutions Architect – Associate (SAA-C03): Deeper knowledge is required, including use cases for high availability, NAT Gateways, and the cost implications of idle EIPs. Exam questions often test the difference between an EIP and a standard public IP.
- AWS Certified SysOps Administrator – Associate (SOA-C02): Practical knowledge of allocating, associating, and remapping EIPs for failover scenarios is key.
Examinees should know that an EIP is used to mask instance failure, the default quota is 5 per region, and that there are charges for idle EIPs.
Frequently Asked Questions
Q: Is an Elastic IP address free?
A: No. As of February 1, 2024, AWS charges for all public IPv4 addresses, including all in-use and idle Elastic IP addresses. The AWS Free Tier provides 750 hours of public IPv4 address usage per month, which covers one EIP.
Q: What happens to my Elastic IP if I stop my EC2 instance?
A: The Elastic IP address remains allocated to your account and associated with the stopped instance. However, you will be charged for the EIP while the instance is stopped, as it is considered an idle address.
Q: Can I move an Elastic IP address to another AWS Region?
A: No, an Elastic IP address is for use in a specific AWS Region only and cannot be moved to a different Region. If you need a static IP that can route traffic to resources in different Regions, you should use AWS Global Accelerator.
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.