aws_eip_association cost estimation
An EIP association is free. It binds an Elastic IP to an instance or network interface. The cost sits on the Elastic IP itself, which is free while attached to a running instance and billed when idle.
An aws_eip_association attaches an already-allocated Elastic IP to an EC2 instance or a specific elastic network interface. The association action is free; it is just a binding. It exists as a separate resource so you can allocate an EIP and associate it independently, which is handy for failover patterns.
The cost lives on the Elastic IP, not the association. As of the 2024 pricing change, AWS charges about $0.005/hour (~$3.60/month) for every public IPv4 address you hold, including Elastic IPs, whether attached or not. Historically an EIP was free while associated with a running instance and billed only when idle; now the in-use discount is gone and essentially all public IPv4 addresses carry the hourly charge. An unassociated EIP, or one on a stopped instance, is still billed. So the association does not create cost, but it also no longer waives it.
The optimization is to hold fewer public IPv4 addresses: release Elastic IPs you no longer serve traffic on, front services with a load balancer or CloudFront so backends can live on private IPs, and adopt IPv6 where possible. c3x prices the Elastic IP addresses in your configuration and treats the association resource itself as free.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "aws_eip_association" "web" {
instance_id = aws_instance.web.id
allocation_id = aws_eip.web.id
}Pricing dimensions
What you actually pay for when you provision aws_eip_association.
| Dimension | Unit | What's being charged |
|---|---|---|
| EIP association | free | Binding an Elastic IP to an instance or interface has no charge. $0 |
| Elastic IP address | per hour | The public IPv4 address itself is billed hourly whether attached or idle. ~$0.005/hour (~$3.60/month) |
| Data transfer out | per GB | Internet egress from the associated instance follows standard rates. ~$0.09/GB egress |
Optimization tips
Common ways to reduce aws_eip_association cost without changing the workload.
Release Elastic IPs you do not need
~$3.60/month per address releasedEvery public IPv4 address, attached or not, is billed about $3.60/month. Release EIPs left over from old instances or failover tests to stop the charge.
Put backends behind a load balancer
Front instances with an ALB or NLB so the backends use private IPs, cutting the number of Elastic IPs you allocate and pay for.
Adopt IPv6 for public endpoints
IPv6 addresses are not subject to the public IPv4 hourly charge. Serving over IPv6 where clients support it reduces IPv4 address count.
FAQ
Does an EIP association cost money?
No. The association that binds an Elastic IP to an instance is free. The cost is the Elastic IP address itself, billed about $0.005/hour whether it is attached or idle.
Is an Elastic IP still free while attached to a running instance?
No longer. Since the 2024 public IPv4 pricing change, essentially all public IPv4 addresses, including attached Elastic IPs, are billed at about $0.005/hour. The old in-use discount is gone.
How do I avoid Elastic IP charges?
Hold fewer public IPv4 addresses: release unused Elastic IPs, front backends with a load balancer so they use private IPs, and serve over IPv6 where possible. The association itself never costs anything.
Related resources
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including aws_eip_association.