Skip to main content

How to Manage Elastic IP in AWS?

In this article, we will discuss "How to Manage Elastic IP in AWS?". Here, you will learn the use of Elastic IP addresses and how to assign it to your EC2 Instance.

If you are new with EC2 Instance then check out my previous article, "How to setup an EC2 Instance on AWS". EC2 (Amazon Elastic Compute Cloud) provide us an ability to create, start, stop and terminate the instance at any time. This will creates a challenge with IP addresses, because restarting an instance or replacing a terminated instance with newly created instance, will result in a new IP address.

Now the question is "How to reference a machine when the IP is constantly change?".

We can handle this situation with the use of Elastic IP address. We can associate a single Elastic IP address to different Ec2 Instances. You can immediately associate a new Ec2 Instance with the Elastic IP address if the EC2 instance is stopped or terminated. After the back-end EC2 instance changes, our existing application will not break because they the expected IP address is not changed.

Prerequisites


A running EC2 Instance. Check this "How to setup an EC2 Instance on AWS".

Create Elastic IP address


Login to your AWS account and go to EC2 Instance Console. Then, click to "Network & Security -> Elastic IP" as per the following screenshot.



After that click on the "Allocate Elastic IP address".


Associate Elastic IP address


You have redirected to the "Allocate Elastic IP Address" screen. Here, click on the "Allocate" button.



After clicking on the Allocate button, you have redirected to the "Elastic IP Address" screen with successful notifications.



Once an IP is allocated we need to associate it with the EC2 Instance. Select the IP address and click "Actions -> Associate Elastic IP address".



In the Resource type choose "Instance" and choose the instance from the drop-down on the Instance field. If you have any other Elastic IP address assigned before and you need to re-associate then you can enable the checkbox in "Re-association". After applying those changes click on the "Associate" button.


Release Elastic IP address


It's mandatory to release the elastic IP address if not in the use. Otherwise, AWS charge you the IP addresses you created even if your instance is terminated or stopped. For more details you can check here. Before releasing the Elastic IP address, you have to "Deassociate the Elastic IP address".





Click to the "Deassociate" button. After that we will redirected to the Elastic IP address dashboard.

Now go to "Actions -> Release Elastic IP Addresses".



After click, a popup appears to release the IP address. Click on the "Release" button. That it, Elastic IP address is release from your account.


Conclusion


In this article, we are discussing "How to Manage Elastic IP in AWS?". Hope you like this article, I tried to explain the AWS Elastic IP Addresses in a simple and easy way. Please feel free to add comments if any queries or also send me feedback.

Keep learning & stay safe :)



You may like:


Basic Understanding on AWS Lambda


Manage AWS Lambda Versioning and Aliases


How to Upload File to AWS S3 Bucket Laravel


How to Send SMS with AWS SNS using Lambda & Python


Setup AWS Pinpoint (Part 1)

Comments

Popular posts from this blog

Laravel Logging Guzzle Requests in File

In this article, we will discuss “Laravel Logging Guzzle Requests in File”. In the multiple scenarios, we have to use third-party API’s in our project and test those API using postman or any other tool. But also required to maintain a log for each request, such as what we send (request)? and what we receive (response)? Today, […] Read out the full post at here

How to Use SSH with AWS EC2 Instance?

In this article, we will discuss "How to Use SSH with AWS EC2 Instance?" . As I already explain the setup of EC2 Instance and the use of an Elastic IP in my previous article. Today, we will learn how to connect an EC2 instance using SSH. If still, you have not read my previous articles then I recommend checking them once for a better understanding. Prerequisites A running EC2 Instance . Elastic IP (Optional for this article) ".pem" file, which is downloaded when setup the EC2 Instance. If not having the ".pem" file, then you have to create new key/value pairs. Connect via Terminal or WSL(Window Subsystem for Linux) Open your terminal and go to the directory where you downloaded your ".pem" file. Use the following command to connect with the server. ssh -i "****.pem" username@<publicDNS> or <IP Address> The same terminal command can be used in the windows Linux terminal. I'm using ubuntu on my windows machine...

How to Setup and Install Next.js App?

In this article, we will discuss "How to Setup and Install Next.js App" from scratch. What is React.js and Next.js? "React.js" is a JavaScript library for building user interfaces (elements that users see and interacting on-screen). Basically, React provide us some helpful functions to build UI, and leaves it on us where to use those functions in the application. "Next.js" is a React framework. It is maintained by "Vercel" . Next.js features to solve common application requirements such as routing, data fetching, integrations - all while improving the developer and end-user experience. Why we use Next.js ? Next.js comes with the some additional features to solve come application requirements such as: We can build SSG (Static Site Generation), SSR (Server-Side Rendering) and SPA (Single Page Application) apps. Hot code Reloading: Reload the page when it detects any change saved. Routing: No need to configure any route. Files put in the pages fol...