Elastic IP

Elastic IP (EIP) 

Elastic IP (EIP) in Amazon Web Services (AWS) is one of the most important networking components used for ensuring high availability, fault tolerance, and reliable public connectivity for Amazon EC2 instances. An Elastic IP is a static, public IPv4 address that remains persistent with your AWS account until you choose to release it. This makes Elastic IPs extremely valuable for applications that require stable public endpoints, seamless failover mechanisms, and uninterrupted external access.

In modern cloud architectures, public IP addressing plays a significant role, especially for web servers, application servers, monitoring servers, bastion hosts, and NAT configurations. Unlike regular public IPs automatically assigned by AWS, Elastic IPs do not change during instance stops, terminations, or network interface replacements (unless manually disassociated). This reliability makes EIPs preferred for production-grade, customer-facing environments.

What is an Elastic IP Address?

An Elastic IP is a static, public IPv4 address designed for dynamic cloud computing. It is allocated to your AWS account and can be associated with any EC2 instance, network interface (ENI), or NAT gateway within a Region. Unlike auto-assigned public IPs, which change on every instance stop/start cycle, EIPs remain constant. This means users or customers can always reach your application using the same IP address.

Characteristics of Elastic IP Addresses

1. Static Public IPv4 Address

Elastic IPs are fixed public IPv4 addresses. Since IPv4 space is limited, AWS imposes usage restrictions and charges for unused EIPs. A static IP is vital for DNS records, external integrations, secure API endpoints, and load balancer fallback mechanisms.

2. Owned by AWS Accounts

When you allocate an EIP, it gets associated with your AWS account, not with any instance directly. You are free to attach or detach it from instances, ENIs, or NAT gateways anytime. This flexibility is foundational for failover and high availability architectures.

3. Region-Specific

Elastic IPs cannot be used across Regions. If you operate in multiple Regions, separate EIPs must be created for each Region. This is a common design oversight, so cloud architects must plan EIP distribution based on global application deployment.

4. Can Be Remapped Quickly

EIPs can be instantly remapped from one instance to another. In case an instance fails, the EIP can be reassigned to a standby instance, ensuring minimal downtime. This capability is widely used in disaster recovery and fault-tolerant application architectures.

5. Charges Apply for Unassociated EIPs

AWS charges for idle Elastic IPs to avoid unnecessary hoarding of IPv4 addresses. If an EIP is not associated with a running instance, AWS applies hourly charges. This aligns with AWS’s cost optimization best practices.

6. EIPs Support ENIs (Elastic Network Interfaces)

Modern EC2 designs often use ENIs for smoother failover. Instead of remapping EIPs at the instance level, the EIP remains attached to an ENI, and the ENI can be moved to another instance. This results in zero downtime transitions.

Why Do We Need Elastic IP Addresses?

Elastic IP addresses solve several key problems in cloud infrastructure. Since cloud environments are dynamic, instances may crash, restart, or be redeployed. Standard public IP addresses change on every stop/start cycle, making them unreliable for production environments. EIPs provide persistent public addressing, which is critical for:

  • Hosting websites and web applications
  • SSH/RDP access through a stable IP
  • DNS configurations (A records, API endpoints)
  • Disaster recovery solutions
  • Multi-tier architecture involving NAT or Bastion hosts
  • Failover and high availability infrastructure
  • External vendor or partner systems requiring static allowlisted IPs

In corporate environments, firewalls often require static IPs to whitelist inbound/outbound traffic. Elastic IPs make this possible without relying on dynamic addressing.

How Elastic IP Addresses Work in AWS

The functionality of Elastic IPs revolves around the combination of AWS-managed public IP routing, network interfaces, and user operations. Here’s the complete lifecycle:

1. Allocation of EIP

When you allocate an Elastic IP from AWS, you reserve the IP under your account. This does not associate it to any instance yet. It becomes available in the Amazon EC2 console under the β€œElastic IPs” section.

2. Association with an Instance or ENI

You can associate the EIP with:

  • An EC2 Instance
  • A Network Interface (ENI)
  • A NAT Gateway

Association creates a route from the Internet to your resource.

3. Remapping or Reassociation

EIPs can be remapped instantly. If the associated instance crashes, you can move the EIP to a backup instance or ENI. This is a key advantage over traditional datacenter environments where IP changes require lengthy DNS updates.

4. Release of EIP

When an EIP is no longer needed, you can release it back to the AWS pool. Once released, you cannot control whether the address may later be assigned to someone else.

Elastic IP Use Cases in AWS

1. Web Hosting with Static IP

When you host public-facing websites on EC2 instances, an Elastic IP ensures that the site's IP remains constant even when servers are stopped or replaced. This helps maintain reliability for DNS mapping.

2. Bastion Host / Jump Server

Administrators frequently use an EIP with a bastion host to securely access private instances. Since teams use the same IP to connect, switching instances during maintenance is seamless.

3. NAT Instance / NAT Gateway

NAT devices require public IPs to allow private subnet resources to communicate with the internet. EIPs provide stable addressing for these NAT services.

4. Disaster Recovery and High Availability

EIPs allow quick failover from one EC2 instance to another. You can maintain standby instances that take over instantly when primary workloads fail.

5. API Servers Requiring Whitelisting

External partners or banks often require static IP allowlisting. EIPs guarantee a fixed outbound IP address that can be safely whitelisted.

6. Migration from On-Premises to Cloud

During lift-and-shift migrations, EIPs simplify DNS transitions and reduce downtime when migrating applications gradually.

Creating and Using Elastic IP Addresses

1. Steps to Allocate an Elastic IP

To allocate an EIP using the AWS Management Console:


1. Open the Amazon EC2 Console.
2. Navigate to "Network & Security".
3. Click "Elastic IPs".
4. Choose "Allocate Elastic IP Address".
5. Select the Network Border Group (usually Region-specific).
6. Click "Allocate".

2. Associating an Elastic IP with an EC2 Instance


1. Select the allocated Elastic IP.
2. Click "Actions".
3. Choose "Associate Elastic IP Address".
4. Select the instance or network interface.
5. Confirm the association.

3. Disassociating an EIP


1. Select the Elastic IP.
2. Click "Actions".
3. Choose "Disassociate Elastic IP Address".
4. Confirm disassociation.

4. Releasing an EIP


1. Select the Elastic IP.
2. Click "Actions".
3. Choose "Release Elastic IP Address".
4. Confirm release.

Elastic IP and Elastic Network Interface (ENI)

ENIs are virtual network cards in AWS, and EIPs can be attached to ENIs instead of directly to instances. This provides an extra level of flexibility and reliability.

EIP to an ENI:

  • Easier failover between instances
  • Preserves network attributes
  • Zero downtime switching
  • Useful for auto-scaling environments

In modern architectures, attaching EIPs to ENIs is preferred over direct instance-level association.

Pricing and Cost Optimization for Elastic IP

AWS pricing for EIPs encourages efficient usage of public IPv4 addresses. Key rules include:

  • One EIP associated with a running instance is free.
  • Charges apply for each additional EIP.
  • Charges apply for EIPs not associated with a running resource.
  • Charges apply if the EIP is associated with a stopped instance.

Cost Optimization Tips

  • Release unused EIPs immediately.
  • Use AWS Load Balancers instead of depending on multiple EIPs.
  • Use Route 53 DNS to make use of dynamic mappings instead of static IPs.
  • Monitor EIP usage using AWS Cost Explorer.

Elastic IP 

1. Avoid Unnecessary EIP Allocation

Allocate only required EIPs. Use Elastic Load Balancers and DNS whenever possible instead of assigning several static IPs.

2. Monitor Idle EIPs

AWS CloudWatch or Cost Explorer should be used to track idle EIPs to avoid unwanted charges.

3. Use DNS Instead of Hardcoding IPs

While EIPs offer static addressing, always point your domains using DNS instead of hardcoding IPs inside your applications. This makes infrastructure more flexible.

4. Use ENIs for High Availability

Attach EIPs to ENIs instead of directly to instances to improve failover capabilities.

5. Implement Automation

Use IAM policies and automation scripts to allocate, assign, and release EIPs systematically.

 Misconceptions about Elastic IP

1. EIP Is Not Free

Only one EIP associated with a running instance is free. Many new users assume all EIPs are free.

2. EIP Does Not Move Automatically

When an instance fails, EIP must be manually or automatically reassigned to another instance.

3. EIP Does Not Guarantee Fault Tolerance by Itself

Elastic IP supports failover but does not automatically provide high availability. Additional automation or standby instances are required.

Security Considerations for Elastic IP Addresses

  • Use Security Groups and NACLs to restrict inbound/outbound traffic.
  • Avoid exposing sensitive applications directly using an EIP.
  • Use HTTPS/TLS for secure communication.
  • Regularly audit EIP associations.

Step-by-Step Example: Setting Up an Elastic IP for a Web Server


1. Launch an EC2 instance in a public subnet.
2. Ensure the subnet has an Internet Gateway.
3. Allocate a new Elastic IP.
4. Associate the EIP with the EC2 instance.
5. Update Security Group to allow port 80/443.
6. Deploy your application or web server.
7. Test the public access using the EIP from a browser.

Elastic IPs are a powerful networking resource in AWS, enabling stable public connectivity, high availability configurations, and dynamic cloud architecture flexibility. They are ideal for public-facing systems, bastion hosts, NAT gateways, and recovery solutions. With conscious cost and security management, Elastic IPs become one of the foundational tools in an AWS architect’s design toolkit.

logo

AWS

Beginner 5 Hours

Elastic IP (EIP) 

Elastic IP (EIP) in Amazon Web Services (AWS) is one of the most important networking components used for ensuring high availability, fault tolerance, and reliable public connectivity for Amazon EC2 instances. An Elastic IP is a static, public IPv4 address that remains persistent with your AWS account until you choose to release it. This makes Elastic IPs extremely valuable for applications that require stable public endpoints, seamless failover mechanisms, and uninterrupted external access.

In modern cloud architectures, public IP addressing plays a significant role, especially for web servers, application servers, monitoring servers, bastion hosts, and NAT configurations. Unlike regular public IPs automatically assigned by AWS, Elastic IPs do not change during instance stops, terminations, or network interface replacements (unless manually disassociated). This reliability makes EIPs preferred for production-grade, customer-facing environments.

What is an Elastic IP Address?

An Elastic IP is a static, public IPv4 address designed for dynamic cloud computing. It is allocated to your AWS account and can be associated with any EC2 instance, network interface (ENI), or NAT gateway within a Region. Unlike auto-assigned public IPs, which change on every instance stop/start cycle, EIPs remain constant. This means users or customers can always reach your application using the same IP address.

Characteristics of Elastic IP Addresses

1. Static Public IPv4 Address

Elastic IPs are fixed public IPv4 addresses. Since IPv4 space is limited, AWS imposes usage restrictions and charges for unused EIPs. A static IP is vital for DNS records, external integrations, secure API endpoints, and load balancer fallback mechanisms.

2. Owned by AWS Accounts

When you allocate an EIP, it gets associated with your AWS account, not with any instance directly. You are free to attach or detach it from instances, ENIs, or NAT gateways anytime. This flexibility is foundational for failover and high availability architectures.

3. Region-Specific

Elastic IPs cannot be used across Regions. If you operate in multiple Regions, separate EIPs must be created for each Region. This is a common design oversight, so cloud architects must plan EIP distribution based on global application deployment.

4. Can Be Remapped Quickly

EIPs can be instantly remapped from one instance to another. In case an instance fails, the EIP can be reassigned to a standby instance, ensuring minimal downtime. This capability is widely used in disaster recovery and fault-tolerant application architectures.

5. Charges Apply for Unassociated EIPs

AWS charges for idle Elastic IPs to avoid unnecessary hoarding of IPv4 addresses. If an EIP is not associated with a running instance, AWS applies hourly charges. This aligns with AWS’s cost optimization best practices.

6. EIPs Support ENIs (Elastic Network Interfaces)

Modern EC2 designs often use ENIs for smoother failover. Instead of remapping EIPs at the instance level, the EIP remains attached to an ENI, and the ENI can be moved to another instance. This results in zero downtime transitions.

Why Do We Need Elastic IP Addresses?

Elastic IP addresses solve several key problems in cloud infrastructure. Since cloud environments are dynamic, instances may crash, restart, or be redeployed. Standard public IP addresses change on every stop/start cycle, making them unreliable for production environments. EIPs provide persistent public addressing, which is critical for:

  • Hosting websites and web applications
  • SSH/RDP access through a stable IP
  • DNS configurations (A records, API endpoints)
  • Disaster recovery solutions
  • Multi-tier architecture involving NAT or Bastion hosts
  • Failover and high availability infrastructure
  • External vendor or partner systems requiring static allowlisted IPs

In corporate environments, firewalls often require static IPs to whitelist inbound/outbound traffic. Elastic IPs make this possible without relying on dynamic addressing.

How Elastic IP Addresses Work in AWS

The functionality of Elastic IPs revolves around the combination of AWS-managed public IP routing, network interfaces, and user operations. Here’s the complete lifecycle:

1. Allocation of EIP

When you allocate an Elastic IP from AWS, you reserve the IP under your account. This does not associate it to any instance yet. It becomes available in the Amazon EC2 console under the “Elastic IPs” section.

2. Association with an Instance or ENI

You can associate the EIP with:

  • An EC2 Instance
  • A Network Interface (ENI)
  • A NAT Gateway

Association creates a route from the Internet to your resource.

3. Remapping or Reassociation

EIPs can be remapped instantly. If the associated instance crashes, you can move the EIP to a backup instance or ENI. This is a key advantage over traditional datacenter environments where IP changes require lengthy DNS updates.

4. Release of EIP

When an EIP is no longer needed, you can release it back to the AWS pool. Once released, you cannot control whether the address may later be assigned to someone else.

Elastic IP Use Cases in AWS

1. Web Hosting with Static IP

When you host public-facing websites on EC2 instances, an Elastic IP ensures that the site's IP remains constant even when servers are stopped or replaced. This helps maintain reliability for DNS mapping.

2. Bastion Host / Jump Server

Administrators frequently use an EIP with a bastion host to securely access private instances. Since teams use the same IP to connect, switching instances during maintenance is seamless.

3. NAT Instance / NAT Gateway

NAT devices require public IPs to allow private subnet resources to communicate with the internet. EIPs provide stable addressing for these NAT services.

4. Disaster Recovery and High Availability

EIPs allow quick failover from one EC2 instance to another. You can maintain standby instances that take over instantly when primary workloads fail.

5. API Servers Requiring Whitelisting

External partners or banks often require static IP allowlisting. EIPs guarantee a fixed outbound IP address that can be safely whitelisted.

6. Migration from On-Premises to Cloud

During lift-and-shift migrations, EIPs simplify DNS transitions and reduce downtime when migrating applications gradually.

Creating and Using Elastic IP Addresses

1. Steps to Allocate an Elastic IP

To allocate an EIP using the AWS Management Console:

1. Open the Amazon EC2 Console. 2. Navigate to "Network & Security". 3. Click "Elastic IPs". 4. Choose "Allocate Elastic IP Address". 5. Select the Network Border Group (usually Region-specific). 6. Click "Allocate".

2. Associating an Elastic IP with an EC2 Instance

1. Select the allocated Elastic IP. 2. Click "Actions". 3. Choose "Associate Elastic IP Address". 4. Select the instance or network interface. 5. Confirm the association.

3. Disassociating an EIP

1. Select the Elastic IP. 2. Click "Actions". 3. Choose "Disassociate Elastic IP Address". 4. Confirm disassociation.

4. Releasing an EIP

1. Select the Elastic IP. 2. Click "Actions". 3. Choose "Release Elastic IP Address". 4. Confirm release.

Elastic IP and Elastic Network Interface (ENI)

ENIs are virtual network cards in AWS, and EIPs can be attached to ENIs instead of directly to instances. This provides an extra level of flexibility and reliability.

EIP to an ENI:

  • Easier failover between instances
  • Preserves network attributes
  • Zero downtime switching
  • Useful for auto-scaling environments

In modern architectures, attaching EIPs to ENIs is preferred over direct instance-level association.

Pricing and Cost Optimization for Elastic IP

AWS pricing for EIPs encourages efficient usage of public IPv4 addresses. Key rules include:

  • One EIP associated with a running instance is free.
  • Charges apply for each additional EIP.
  • Charges apply for EIPs not associated with a running resource.
  • Charges apply if the EIP is associated with a stopped instance.

Cost Optimization Tips

  • Release unused EIPs immediately.
  • Use AWS Load Balancers instead of depending on multiple EIPs.
  • Use Route 53 DNS to make use of dynamic mappings instead of static IPs.
  • Monitor EIP usage using AWS Cost Explorer.

Elastic IP 

1. Avoid Unnecessary EIP Allocation

Allocate only required EIPs. Use Elastic Load Balancers and DNS whenever possible instead of assigning several static IPs.

2. Monitor Idle EIPs

AWS CloudWatch or Cost Explorer should be used to track idle EIPs to avoid unwanted charges.

3. Use DNS Instead of Hardcoding IPs

While EIPs offer static addressing, always point your domains using DNS instead of hardcoding IPs inside your applications. This makes infrastructure more flexible.

4. Use ENIs for High Availability

Attach EIPs to ENIs instead of directly to instances to improve failover capabilities.

5. Implement Automation

Use IAM policies and automation scripts to allocate, assign, and release EIPs systematically.

 Misconceptions about Elastic IP

1. EIP Is Not Free

Only one EIP associated with a running instance is free. Many new users assume all EIPs are free.

2. EIP Does Not Move Automatically

When an instance fails, EIP must be manually or automatically reassigned to another instance.

3. EIP Does Not Guarantee Fault Tolerance by Itself

Elastic IP supports failover but does not automatically provide high availability. Additional automation or standby instances are required.

Security Considerations for Elastic IP Addresses

  • Use Security Groups and NACLs to restrict inbound/outbound traffic.
  • Avoid exposing sensitive applications directly using an EIP.
  • Use HTTPS/TLS for secure communication.
  • Regularly audit EIP associations.

Step-by-Step Example: Setting Up an Elastic IP for a Web Server

1. Launch an EC2 instance in a public subnet. 2. Ensure the subnet has an Internet Gateway. 3. Allocate a new Elastic IP. 4. Associate the EIP with the EC2 instance. 5. Update Security Group to allow port 80/443. 6. Deploy your application or web server. 7. Test the public access using the EIP from a browser.

Elastic IPs are a powerful networking resource in AWS, enabling stable public connectivity, high availability configurations, and dynamic cloud architecture flexibility. They are ideal for public-facing systems, bastion hosts, NAT gateways, and recovery solutions. With conscious cost and security management, Elastic IPs become one of the foundational tools in an AWS architect’s design toolkit.

Related Tutorials

Frequently Asked Questions for AWS

An AWS Region is a geographical area with multiple isolated availability zones. Regions ensure high availability, fault tolerance, and data redundancy.

AWS EBS (Elastic Block Store) provides block-level storage for use with EC2 instances. It's ideal for databases and other performance-intensive applications.



  • S3: Object storage for unstructured data.
  • EBS: Block storage for structured data like databases.

  • Regions are geographic areas.
  • Availability Zones are isolated data centers within a region, providing high availability for your applications.

AWS pricing follows a pay-as-you-go model. You pay only for the resources you use, with options like on-demand instances, reserved instances, and spot instances to optimize costs.



AWS S3 (Simple Storage Service) is an object storage service used to store and retrieve any amount of data from anywhere. It's ideal for backup, data archiving, and big data analytics.



Amazon RDS (Relational Database Service) is a managed database service supporting engines like MySQL, PostgreSQL, Oracle, and SQL Server. It automates tasks like backups and updates.



  • Scalability: Resources scale based on demand.
  • Cost-efficiency: Pay-as-you-go pricing.
  • Global Reach: Availability in multiple regions.
  • Security: Advanced encryption and compliance.
  • Flexibility: Supports various workloads and integrations.

AWS Auto Scaling automatically adjusts the number of compute resources based on demand, ensuring optimal performance and cost-efficiency.

The key AWS services include:


  • EC2 (Elastic Compute Cloud) for scalable computing.
  • S3 (Simple Storage Service) for storage.
  • RDS (Relational Database Service) for databases.
  • Lambda for serverless computing.
  • CloudFront for content delivery.

AWS CLI (Command Line Interface) is a tool for managing AWS services via commands. It provides scripting capabilities for automation.

Amazon EC2 is a web service that provides resizable compute capacity in the cloud. It enables you to launch virtual servers and manage your computing resources efficiently.

AWS Snowball is a physical device used for data migration. It allows organizations to transfer large amounts of data into AWS quickly and securely.

AWS CloudWatch is a monitoring service that collects and tracks metrics, logs, and events, helping you gain insights into your AWS infrastructure and applications.



AWS (Amazon Web Services) is a comprehensive cloud computing platform provided by Amazon. It offers on-demand cloud services such as compute power, storage, databases, networking, and more.



Elastic Load Balancer (ELB) automatically distributes incoming traffic across multiple targets (e.g., EC2 instances) to ensure high availability and fault tolerance.

Amazon VPC (Virtual Private Cloud) allows you to create a secure, isolated network within the AWS cloud, enabling you to control IP ranges, subnets, and route tables.



Route 53 is a scalable DNS (Domain Name System) web service by AWS. It connects user requests to your applications hosted on AWS resources.

AWS CloudFormation is a service that enables you to manage and provision AWS resources using infrastructure as code. It automates resource deployment through JSON or YAML templates.



AWS IAM (Identity and Access Management) allows you to control access to AWS resources securely. You can define user roles, permissions, and policies to ensure security and compliance.



  • EC2: Provides virtual servers for full control of your applications.
  • Lambda: Offers serverless computing, automatically running your code in response to events without managing servers.

Elastic Beanstalk is a PaaS (Platform as a Service) offering by AWS. It simplifies deploying and managing applications by automatically handling infrastructure provisioning and scaling.



Amazon SQS (Simple Queue Service) is a fully managed message queuing service that decouples and scales distributed systems.

AWS ensures data security through encryption (both at rest and in transit), compliance with standards (e.g., ISO, SOC, GDPR), and access controls using IAM.

AWS Lambda is a serverless computing service that lets you run code in response to events without provisioning or managing servers. You pay only for the compute time consumed.



AWS Identity and Access Management controls user access and permissions securely.

A serverless compute service running code automatically in response to events.

A Virtual Private Cloud for isolated AWS network configuration and control.

Automates resource provisioning using infrastructure as code in AWS.

A monitoring tool for AWS resources and applications, providing logs and metrics.

A virtual server for running applications on AWS with scalable compute capacity.

Distributes incoming traffic across multiple targets to ensure fault tolerance.

A scalable object storage service for backups, data archiving, and big data.

EC2, S3, RDS, Lambda, VPC, IAM, CloudWatch, DynamoDB, CloudFront, and ECS.

Tracks user activity and API usage across AWS infrastructure for auditing.

A managed relational database service supporting multiple engines like MySQL, PostgreSQL, and Oracle.

An isolated data center within a region, offering high availability and fault tolerance.

A scalable Domain Name System (DNS) web service for domain management.

Simple Notification Service sends messages or notifications to subscribers or other applications.

Brings native AWS services to on-premises locations for hybrid cloud deployments.

Automatically adjusts compute capacity to maintain performance and reduce costs.

Amazon Machine Image contains configuration information to launch EC2 instances.

Elastic Block Store provides block-level storage for use with EC2 instances.

Simple Queue Service enables decoupling and message queuing between microservices.

A serverless compute engine for containers running on ECS or EKS.

Manages and groups multiple AWS accounts centrally for billing and access control.

Distributes incoming traffic across multiple EC2 instances for better performance.

A tool for visualizing, understanding, and managing AWS costs and usage over time.

line

Copyrights © 2024 letsupdateskills All rights reserved