AWS Solutions Architect Associate Certification
Services Networking
Elastic IP
In this article, we explore AWS Elastic IPs and their critical role in managing EC2 instances. Understanding the differences between dynamic public IPs and static Elastic IPs can help maintain a reliable connection for your applications.
When an EC2 instance is deployed in a public subnet, it automatically receives a public IP address (for example, 1.1.1.1). However, this public IP is temporary; AWS does not assign permanent ownership to you. Consequently, if the instance is rebooted, it might receive a different public IP—resulting in potential disruption for applications relying on a consistent backend address.
Static vs Dynamic IPs
A static Elastic IP remains constant, ensuring that even if your EC2 instance is rebooted or relocated to a different physical server, the IP address stays the same.
What Are Elastic IPs?
Elastic IP addresses are static IPv4 addresses allocated to your AWS account. Once allocated, the address is reserved exclusively for your use and cannot be allocated to others. You can then associate an Elastic IP with an EC2 instance so that it keeps the same IP address, regardless of reboots or host migration.
Key Benefits
- Consistent Connectivity: End users always connect to the same IP, improving reliability.
- Flexibility in Maintenance: You can easily reassign the Elastic IP from one server to another during scheduled maintenance or unexpected server issues.
The diagram below shows how an Elastic IP (1.1.1.1) is reassigned from Server A to Server B, ensuring uninterrupted service:
Pricing Structure
Elastic IPs assigned to a running instance incur no additional cost. However, additional considerations include:
- Associating extra Elastic IPs with an instance.
- Reserving an Elastic IP without associating it.
Both scenarios will result in a small hourly fee. The following diagram outlines the pricing model, showing that additional or unused reserved Elastic IPs are billed per hour:
Cost Management
Ensure you manage and monitor your Elastic IP usage to avoid unexpected charges, especially for unused or extra reserved IPs.
Regional Specificity and IP Origins
Elastic IPs are tied to specific AWS regions and cannot be transferred across regions. They can be associated only with EC2 instances within the same region. Additionally, these IP addresses are sourced either from AWS’s pool of IPv4 addresses or from a custom pool you bring to your account. The infographic below reinforces these points:
How to Use an Elastic IP
To take advantage of Elastic IPs:
- Allocate an Elastic IP to your AWS account.
- Associate the allocated IP with your EC2 instance or network interface.
In summary, while public IP addresses assigned to EC2 instances are dynamic and can change, Elastic IPs offer a static solution that ensures a consistent point of entry for your applications. Remember, Elastic IPs are region-specific and must be allocated and associated within the same region.
Watch Video
Watch video content