Description
For an unassociated Elastic IP address, check who reserved it and why.
Potential impact
AWS-provided public IPv4 addresses incur charges whether they are idle or in use.
Remediation
Check EC2 instances, network interfaces, NAT gateways, and DNS records for dependencies. Document addresses you need to keep. Release an address only after confirming it has no planned use or remaining dependencies.
Examples
The examples allocate an address and then associate it with aws_instance.ec2. Supply the instance and its network separately.
Before
hcl
resource "aws_eip" "example" {
}
After
hcl
resource "aws_eip" "example" {
instance = aws_instance.ec2.id
domain = "vpc"
}
You may be unable to recover the same address after release.