aws_eip cost estimation
A static public IPv4 address. Free while attached and in use, $0.005/hour while detached or unassociated. As of 2024, also charges per-hour for attached IPv4 in some scenarios.
An aws_eip is a static public IPv4 address you can reassign between resources. EIPs were free while attached for over a decade, but AWS introduced changes in 2024 that affect pricing.
The legacy model (still true for many cases): an EIP attached to a running EC2 instance, NAT Gateway, or ELB is free. A detached or unassociated EIP is billed at $0.005/hour ($3.65/month).
The newer model (since February 2024): public IPv4 addresses in general are billed at $0.005/hour regardless of attachment status. This applies to: - Auto-assigned public IPs on EC2 instances (the ones from EC2's pool, not EIPs) - IPs attached to ELB and NAT Gateway - VPC IPv4 endpoints
This change was AWS's response to IPv4 scarcity. Existing EIPs attached to existing resources still benefit from the legacy free-while-attached pricing for backward compatibility, but new public IPv4 attachments do incur charges.
Practical implications: cleanup matters more than it used to. Detached EIPs from terminated instances continue to bill. Forgotten EIPs in old VPCs can add up.
c3x estimates EIPs based on the resource configuration. EIPs declared but not attached are flagged as billing. EIPs attached via aws_eip_association show the appropriate pricing model.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "aws_eip" "nat" {
domain = "vpc"
tags = {
Name = "production-nat-eip"
}
}
resource "aws_eip_association" "nat" {
instance_id = aws_instance.bastion.id
allocation_id = aws_eip.nat.id
}Pricing dimensions
What you actually pay for when you provision aws_eip.
| Dimension | Unit | What's being charged |
|---|---|---|
| EIP detached or unassociated | per hour | Standard pricing for an allocated EIP not currently attached to any resource. $0.005/hour ≈ $3.65/month |
| Public IPv4 (2024+ pricing) | per hour | Per AWS's February 2024 changes, public IPv4 addresses are billed regardless of attachment status for new attachments. $0.005/hour |
| Additional EIPs on same instance | per hour | Beyond the first EIP per running instance, additional attached EIPs are billed even under the legacy model. $0.005/hour each |
| EIP remapping | per remap | First 100 remaps/month free. $0.10 per additional remap. Rarely a meaningful cost. |
Optimization tips
Common ways to reduce aws_eip cost without changing the workload.
Audit and release unused EIPs
$3.65/month per released EIPRun aws ec2 describe-addresses to list all allocated EIPs. Any without an AssociationId is detached and billing. Each one is $3.65/month forever. A handful add up to hundreds per year.
Use only one EIP per resource
$3.65/month per removed EIPAdditional EIPs on the same instance bill separately. For most use cases, one EIP is enough. Pair with a load balancer if you need multiple endpoints.
Skip EIPs for ephemeral workloads
Avoid unnecessary EIPsAuto-assigned public IPs from EC2's pool work for stateless web tiers. EIPs are only needed when the IP must persist across instance restarts. Don't allocate one if you don't need static addressing.
Use IPv6 where possible
100% on IPv6-served trafficIPv6 addresses are free. For workloads with IPv6-capable clients, dual-stack EC2 instances can serve traffic via IPv6 and avoid public IPv4 charges for that traffic.
FAQ
Are EIPs really free when attached?
It depends. EIPs attached before February 2024 retain free-while-attached pricing. New public IPv4 attachments (whether EIPs or auto-assigned IPs) are billed $0.005/hour regardless of attachment status. The line is fuzzy; check AWS billing for the actual behavior in your account.
Why am I billed for a detached EIP I forgot about?
AWS charges $0.005/hour for any EIP that's allocated but not attached to a running resource. The original purpose was to discourage hoarding IPs. Allocated EIPs from terminated instances continue to bill until released via aws ec2 release-address.
Does c3x estimate the 2024 public IPv4 charges?
Yes, with some caveats. The public IPv4 charge is per resource, not per declaration in Terraform. c3x estimates EIPs declared in aws_eip resources. Auto-assigned public IPs from EC2's pool may not be visible in Terraform; they're inferred from associate_public_ip_address attributes.
What about IPv6 addresses?
IPv6 addresses are free in AWS. There's no per-hour charge for IPv6, no allocation limit. If you can serve traffic over IPv6, you save on public IPv4 charges. For IPv6 in c3x-managed resources, no separate cost line item is generated.
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.