Amazon Web Services
Compute
- AWS EC2
- EC2 Instance Types
- EC2 Pricing Models
- EC2 Auto Scaling
- Elastic Load Balancing-ELB
- AWS Lambda – Serverless Computing
- Amazon Lightsail
- AWS Elastic Beanstalk
- AWS Fargate
- Amazon ECS (Elastic Container Service)
- Amazon EKS (Elastic Kubernetes Service)
Storage
- S3 vs. EBS vs. EFS
- Amazon S3 (Simple Storage Service)
- Amazon S3 Storage Classes
- Amazon EBS (Elastic Block Store)
- Amazon EFS (Elastic File System)
- AWS Storage Gateway
- AWS Snowball
- Amazon FSx
- AWS Backup
Database Services
- Amazon RDS
- Amazon Aurora
- Amazon DynamoDB
- Amazon ElastiCache
- Amazon Redshift
- AWS Database Migration Service (DMS)
- Amazon Neptune
- Amazon DocumentD
Networking and Content Delivery
- Amazon VPC
- Subnets
- Internet Gateway
- AWS Direct Connect
- AWS Route 53
- AWS CloudFront
- AWS Transit Gateway
- Elastic IP Addresses
DynamoDB
- DynamoDB Global Table vs Regular DynamoDB Table
- DynamoDB Streams
- Athena query data to DynamoDB
- Athena Query Results with DynamoDB
- PySpark DataFrame to DynamoDB
Redshift
Lambda
Glue
Lambda
Security
🌐 Elastic IP Addresses – Static IPv4 Addresses for AWS Resources
In the dynamic cloud environment, IP addresses often change when an instance is stopped or restarted. This poses challenges for services requiring static IPs, like DNS mapping, web servers, or external integrations.
AWS Elastic IP Addresses (EIP) solve this problem by providing static, public IPv4 addresses that you can allocate to your AWS account and associate with EC2 instances, NAT gateways, or other resources.
Think of Elastic IPs as permanent IP addresses in a cloud world of temporary addresses.
⚙️ Key Features of Elastic IP
- Static IPv4: Remains the same until explicitly released.
- Reassociation: Can move between instances or resources in the same region.
- High Availability: Enables quick failover between EC2 instances.
- Controlled Usage: Charges apply only when the IP is allocated but not attached to a running instance.
- Public Reachability: Useful for external clients to access your AWS services reliably.
🗂️ How Elastic IP Works
- Allocate an EIP: Reserve a static IPv4 in your AWS account.
- Associate with Resource: Attach to an EC2 instance or NAT gateway.
- Use Cases: Provide a fixed endpoint for DNS, API, or external access.
- Reassign as Needed: Move the EIP between instances for failover or scaling.
🛠️ Programs (Python – boto3)
✅ 1: Allocate an Elastic IP
import boto3
ec2 = boto3.client('ec2')
response = ec2.allocate_address(Domain='vpc')print("Elastic IP Allocated:", response['PublicIp'], "Allocation ID:", response['AllocationId'])
Use Case: Reserve a static IPv4 for web server deployment.
✅ 2: Associate Elastic IP with EC2
response = ec2.associate_address( InstanceId='i-0123456789abcdef0', AllocationId='eipalloc-0123456789abcdef0')print("Elastic IP Associated. Association ID:", response['AssociationId'])
Use Case: Attach EIP to a running EC2 instance to provide stable external access.
✅ 3: Reassign Elastic IP to Another Instance
# Disassociate firstec2.disassociate_address(AssociationId='eipassoc-0123456789abcdef0')
# Associate with another instanceresponse = ec2.associate_address( InstanceId='i-0fedcba9876543210', AllocationId='eipalloc-0123456789abcdef0')print("Elastic IP reassigned to new instance. Association ID:", response['AssociationId'])
Use Case: Failover EC2 instance for high availability without DNS changes.
🧠 How to Remember for Exams & Interviews
-
Key Principle: Elastic IP = Static IPv4 for AWS resources.
-
Memory Trick: Think Elastic IP = Elastic (can move) + Static IP (fixed address).
-
Exam Hot Points:
- Can associate only one EIP per instance in a region.
- Charges occur if EIP is allocated but unused.
- Works with EC2 instances, NAT gateways.
🎯 Why Elastic IP is Important
- High Availability: Quickly move IPs between instances during failures.
- DNS Stability: Provides fixed public IPs for external clients.
- Flexibility: Attach and reassign IPs as your infrastructure evolves.
- Cost Management: Only pay when IPs are allocated but not in use.
- Essential for Network Design: Key building block in hybrid cloud and multi-instance setups.
🔒 Best Practices
- Minimize Idle IPs: Release unassociated EIPs to reduce charges.
- Plan Failover Scenarios: Use EIPs for high-availability designs.
- Monitor IP Usage: Use AWS Cost Explorer to track EIP costs.
- Combine with Route 53: Map domain names to static Elastic IPs for stable web access.
- Use for NAT Gateways: Provide consistent external IPs for private subnets.
📘 Conclusion
AWS Elastic IP Addresses are a vital tool for managing static IPs in a cloud environment. They provide reliability, flexibility, and control over how external users and services connect to your AWS resources.
Key Takeaways:
- Static IPv4 addresses for EC2 and NAT gateways
- Can move between resources in a region
- Essential for high-availability, DNS stability, and hybrid setups
Mastering Elastic IPs ensures you can design resilient and accessible AWS architectures, a must-have skill for cloud engineers and architects.