Back to Blog

Finding and Removing Unattached AWS Elastic IP addresses

Unattached Elastic IP Addresses can add extra costs to your monthly AWS bill. In this guide, we'll show you how to find and remove unneeded Elastic IP addresses.

aws-logo

An Amazon Web Services Elastic IP address is a static public IPv4 address allocated to your EC2 instance that you can reach via the internet. EIP addresses are designed for dynamic cloud computing because they can swiftly remap to another instance if their existing instance fails for whatever reason.

Since Elastic IP addresses might be a critical component of your AWS infrastructure, they are charged at an hourly rate, even if they are not being used with a running instance. You may be charged $0.005 per Elastic IP address not associated with a running instance per hour. So across your infrastructure, if you have 50 unattached Elastic IP addresses associated with your account, you’ll be paying $180/month unnecessarily.

In this guide, we will show you how to find and fix unattached Elastic IP addresses in AWS so you can lower your cloud costs.

Finding Unattached AWS Elastic IP Addresses

Being aware of unattached AWS Elastic IP addresses is crucial. This is especially true if you use EC2 - Classic, an older Amazon elastic compute cloud, which disassociates EIP addresses when their related instance is stopped. You would need to manually release your EIP address from a stopped instance to avoid the AWS enforced hourly charges. 

AWS Elastic IP addresses can also become unattached when more than one AWS EIP address is set to be associated with the same EC2 instance.

Here are a couple of methods for finding your unattached AWS Elastic IP addresses: 

Using the AWS Management Console:

  1. Simply log into the console and go to the VPC dashboard.
  2. Then, locate the left navigation panel. Under the "Virtual Private Cloud" section, select "Elastic IPs".
  3. Choose the "Unassociated" filter from the drop down menu to have the console show you your unassociated EIP addresses.
  4. This can be applied to multiple regions to find any other unattached EIPs you may have. Change AWS regions using the navigation bar.

Using the AWS CLI:

  1. By running a "describe-addresses" command, you can list Elastic IPs in the selected region.
 describe-addresses
[--filters <value>]
[--public-ips <value>]
[--allocation-ids <value>]
[--dry-run | --no-dry-run]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]
  1. The command output should provide an array of your available EIPs and their metadata.
  2. You can use this information to locate EIPs that are not returning the "AssociationId" parameter. Those are your EIP addresses that are unattached or unassociated.

Removing AWS Elastic IP Addresses

After detecting your unattached EIPs, the next step is to remove or release them. You should do this as soon as possible to avoid as many hourly charges on your monthly AWS bill. You can remove or release them using the same methods from the previous step.

Using the AWS Management Console:

  1. Select those EIPs.
  2. You have to click the "Actions" drop down button on the top dashboard menu.
  3. You need to select "Release Address."  
  4. In the "Release Address" confirmation box, make sure to review that the correct unattached EIPs have been selected before you click the "Yes, delete" button, which will remove the chosen EIPs from your AWS account.

Using the AWS CLI:

  1. Run the "release-address" command:
 release-address
[--allocation-id <value>]
[--public-ip <value>]
[--network-border-group <value>]
[--dry-run | --no-dry-run]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
  1. Use the EIP's "AllocationId" values for the unattached EIP address when running this command to delete the EIP.

By following these steps, you will be able to cut your AWS costs and ensure that you are cleaning up any unattached EIP addresses.

Detecting Unattached IP Addresses Automatically with Blink

It doesn’t make sense to pay for EIP addresses that you aren’t using, but running through these steps can take time and requires context-switching. If you want to run this type of check often, there’s a better way to do it.

When you create a free Blink account, you can schedule automated checks like this exact one to run regularly so you can stay on top of unattached Elastic IP addresses with no-code/low-code steps and a simple Slack notification.

Blink automation for finding unattached AWS Elastic IP Addresses

Create your free Blink account and start automating this task today.

Simplify your cloud operations

Sign up for Blink today

Transform your cloud operations today with a library of purpose-built DevOps and SecOps playbooks and hundreds of integrations.

Sign up