AWS: release unassociated Elastic IPs

AWS bills every public IPv4 address by the hour, in use or idle. How to find unassociated Elastic IPs, release them safely and prevent them with Terraform.

A reserved Elastic IP that points at nothing, or that was left on an interface with no instance, is billed hourly like any public IPv4 address.

Policy at a glance

Provider
AWS
Resource
Elastic IPs (public IPv4 addresses allocated to the account).
What to check
Addresses with no AssociationId, and those associated with a network interface whose instance no longer exists.
Risk
Medium: the same IP may not come back if another account takes it. Check DNS and allow-lists first.
Effort
Low: one query per region and one release per address.

Why it matters: every public IPv4 address is billed hourly

Since AWS started charging for public IPv4 addresses, an Elastic IP costs the same whether it is in use or not. The EC2 documentation states it like this: there is a charge for all Elastic IP addresses, whether they are allocated to a resource such as an instance or idle in the account. And a disassociated address stays allocated to your account until you explicitly release it.

The Public IPv4 Address tab of the Amazon VPC pricing page (read on 15 November 2026) sets USD 0.005 per hour for both an in-use and an idle public IPv4 address, billed per second with a 60-second minimum, in every commercial region, GovCloud, China and Local Zones. That is about USD 3.60 per address in a 30-day month. The page's own example makes it explicit: four idle Elastic IPs for a month are USD 14.40.

That is why disassociating is not enough: the charge stops only when you release the address. A disassociated IP serves no traffic and bills anyway.

There is a harder case to spot: an Elastic IP that shows as associated, but to a network interface (ENI) whose instance no longer exists. It happens when an instance is terminated and its secondary interface survives holding the address: the console says "associated", it serves nobody, and releasing it fails until the interface lets go.

How to find them

In the console: EC2 → Network & Security → Elastic IPs. The ones with nothing in the Associated instance ID or Network interface ID columns are unassociated.

With the official CLI, describe-addresses returns the ones in the region. The first query lists those with no association; the second, those sitting on an interface with no instance:

aws ec2 describe-addresses \
  --query "Addresses[?AssociationId==null].{IP:PublicIp,ID:AllocationId}" --output table

aws ec2 describe-addresses \
  --query "Addresses[?NetworkInterfaceId!=null && InstanceId==null].{IP:PublicIp,ENI:NetworkInterfaceId}" --output table

The second list needs a human look: a NAT gateway or a load balancer also uses interfaces with no instance, and there the IP is in use. Inspect the interface with aws ec2 describe-network-interfaces --network-interface-ids eni-0123... and check its Status and Description before touching anything. For an organization-wide view, AWS offers Public IP Insights (in the free tier of VPC IPAM), and the Cost and Usage Report tracks public IPv4 usage by hour, day or month.

How to fix it, step by step

Terraform example: detect and prevent

The AWS Config managed rule EIP_ATTACHED flags as NON_COMPLIANT every Elastic IP that is not attached to an instance or to an in-use network interface (it needs an active configuration recorder; AWS notes results can take up to 6 hours). Prevention is a design choice: declare the IP in the same state as the instance that uses it, so terraform destroy releases both.

variable "ami_id" { type = string }

# Detect: AWS Config managed rule.
resource "aws_config_config_rule" "eip_sin_asociar" {
  name = "eip-attached"
  source {
    owner             = "AWS"
    source_identifier = "EIP_ATTACHED"
  }
}

resource "aws_instance" "web" {
  ami           = var.ami_id
  instance_type = "t3.micro"
}

# Prevent: the IP lives and dies with its instance.
resource "aws_eip" "web" {
  domain   = "vpc"
  instance = aws_instance.web.id
}

Validated with terraform validate (Terraform 1.17.2, hashicorp/aws provider 6.73.0). An IP created by hand in the console and referenced from Terraform by its ID is the shortest road to drift: nobody releases it because it is in no state file.

How Control Cloud surfaces it

Control Cloud keeps the association, the instance, the interface (ENI) and that interface's owner from the API for each Elastic IP, and flags both shapes of this problem as orphans: the unassociated address and the one left on an ENI with no instance AND no known service owner (a NAT gateway or a network load balancer also carry no instance id while being genuinely in use — Control Cloud does not flag those as orphans). When it could not confirm who owns the ENI, it shows "unknown" instead of guessing. The Elastic IPs tab has an "Orphans" filter with its count and the canvas shows the same flag. If a release from the app hits an association, the message says what has to be let go first instead of passing on AWS's raw error.

When not to apply it

Frequently asked questions

Does AWS charge for an Elastic IP that is not associated with anything?

Yes. The VPC pricing page charges USD 0.005 per hour for both an in-use and an idle public IPv4 address (read on 15 November 2026), about USD 3.60 per 30-day month. The charge stops when you release the address, not when you disassociate it.

Why can't I release an Elastic IP?

Because it is still associated with a resource. Often it is a network interface that outlived its instance: disassociate the address or delete that interface, then release it.

Can I get the same IP back after releasing it?

Sometimes, with allocate-address and the specific address. Not if another account has already taken it or if it would put you over your quota, and the tags do not come back.

Related policies: Azure: remove unassociated public IPs · Google Cloud: release unused static external IPs · AWS EBS: delete unattached volumes

Glossary terms: Cost and Usage Report (CUR) · Terraform · Drift

Official sources

  1. Amazon VPC — Pricing (Public IPv4 Address tab)
  2. Amazon EC2 — Elastic IP addresses
  3. Amazon EC2 — Release an Elastic IP address
  4. AWS Config — eip-attached rule

Ready to see it on your own infrastructure? Book a demo · Read the documentation