You are currently viewing How to attach/detach an Elastic IP in AWS EC2 Instance

How to attach/detach an Elastic IP in AWS EC2 Instance

Loading

In this blog, we’ll learn about what is Elastic IP in AWS and how to attach an Elastic IP to your AWS EC2 instance. You can use the power of a static IP address to make your Amazon Web Services infrastructure more accessible, reliable, and easy to network.

What is Elastic IP in AWS

An Elastic IP (EIP) is a static IPv4 address designed for dynamic cloud computing within the Amazon Web Services (AWS) ecosystem.

When you start and stop an EC2 instances it changes to public IP.

If you need to have a fixed public IP, you need an Elastic IP.

  • Static IP Address: An Elastic IP provides a static IPv4 address that you can assign to any instance in your VPC.
  • Persistent: Once allocated, an Elastic IP remains associated with your AWS account until you explicitly release it.
  • Reassignable: You can quickly remap an Elastic IP from one instance to another within your account.
  • Failover and High Availability: Elastic IPs are commonly used in scenarios requiring failover or high availability setups, where instances can be quickly replaced without changing IP addresses.

You can only have 5 elastic IP in your account. (In order to increase you have to make a request on aws service quotas)

  • Always keep in mind that the first elastic IP is not charged.
  • An additional price of $0.005 per hour will be incurred for each additional Elastic IP that is associated with the same instance.
  • If an Elastic IP is not connected to an EC2 instance that is currently running, Amazon Web Services will charge you $0.005 per hour.
  • After the initial one hundred remaps, there is a charge of $0.10 per remap that applies if you remap an Elastic IP address more than one hundred times in a single month.

Steps to attach an Elastic IP to Your AWS EC2 Instance

In the previous blog we have seen how to create an EC2 instances.

Next, In the navigation pane, choose Elastic IPs and Click on Allocate Elastic IP address.

Next select the region as us-east-1

And rest everything as default. Click on Allocate.

Next you have to right click and select the Associate Elastic IP address.

Select the resource type which is instance and select the EC2 instance that you want to attach. After that you have to click on associate. Note that you can also enable Reassociation which means allowing the Elastic IP to be reassociated.

Now you have to successfully attached elastic IP to your EC2 instances.

You can check it by clicking on the instances. The public IPV4 address is the new Elastic IP. Now even if you start and stop and EC2 instances the IP address will not change.

Steps to detach Elastic IP Address

Similarly if you want to detach the Elastic IP you have to right click on Dissociate Elastic IP address.

Next click on Action and click on Release Elastic IP address.

click on Release.

Conclusion

In conclusion, adding and removing an Elastic IP from your AWS EC2 server is a simple process that makes it easier for people to access and more reliable. If you handle your networking settings well, you can easily make them work best for your cloud computing needs.

If you like this blog, you can share it with your friends or colleague. You can connect with me on social media profiles like LinkedIn, Twitter, and Instagram. If you have any doubt feel free to comment.

🔔 Follow Me: LinkedInYoutube | Instagram | Twitter

👏 Like for this article and subscribe to our newsletter

📰 View more content on my DataSpoof website