AWS Certified Developer - Associate
Networking Fundamentals
Elastic IP
In this lesson, we explore AWS Elastic IPs and how they help maintain a consistent public IP address for your EC2 instances. This is especially useful when you require a stable endpoint for backend servers or client communications.
Why Use Elastic IPs?
When you deploy an EC2 instance within a public subnet, it automatically receives a public IP address (for example, 1.1.1.1). However, this IP is dynamically allocated and can change upon reboot or restart. This dynamic behavior may disrupt applications that rely on a fixed IP address.
Elastic IP addresses resolve this issue by providing static IPv4 addresses exclusively allocated to your AWS account. Once you allocate an Elastic IP, it remains reserved for you, ensuring the instance maintains the same IP regardless of reboots or hardware migrations.
Key Advantage
Elastic IPs offer the flexibility to disassociate from one instance and reassociate with another during maintenance, ensuring uninterrupted service.
Pricing Considerations
AWS provides an Elastic IP at no extra cost when it is associated with a running EC2 instance. However, if you attach more than one Elastic IP to an instance or reserve an Elastic IP without linking it to a running instance, AWS charges a small hourly fee for the additional allocation.
Key Points to Remember
- Elastic IPs are region-specific and cannot be transferred across AWS regions.
- They can only be associated with EC2 instances within the same region.
- You can obtain Elastic IPs from either Amazon's pool of IPv4 addresses or your custom IPv4 address pool.
How to Allocate and Associate an Elastic IP
To leverage the benefits of an Elastic IP, follow these steps:
- Allocate the Elastic IP to your AWS account.
- Associate the Elastic IP with your EC2 instance or network interface.
This process guarantees that your instance maintains a static public IP even during modifications or migrations.
Static IP Stability
Elastic IPs are essential for applications that demand fixed IP endpoints, particularly during service migrations or routine maintenance.
Summary
EC2 instances with standard public IPs can experience address changes on reboot, whereas Elastic IPs provide a static alternative that ensures continuity and reliability. This stability is fundamental for applications that rely on consistent communication endpoints.
Watch Video
Watch video content