I receive errors when I allocate or release an Elastic IP address that's associated with my Amazon Elastic Compute Cloud (Amazon EC2) instance. Or, I need to restore an Elastic IP address that I accidentally deleted.
Resolution
Take the following troubleshooting actions based on the Elastic IP address issue that you encounter.
I want to restore an accidentally deleted Elastic IP address
If you released your Elastic IP address, then see How do I recover the public IP address or Elastic IP address associated with an EC2 instance?
An associated Elastic IP address didn't release after I terminated the instance
To release an Elastic IP address, you must first disassociate it from resources. Then, you can reassociate it with a different resource. You incur charges for each Elastic IP address that you allocate to use with a virtual private cloud (VPC) but didn't associate with an instance. If you don't need the Elastic IP address, then you can release it.
I receive an error when I allocate a new Elastic IP address
When you allocate a new Elastic IP address, you might receive the following error:
"Elastic IP address could not be allocated. The maximum number of addresses has been reached"
All AWS accounts have a maximum quota of five Elastic IP addresses in each AWS Region. To resolve this issue, check how many Elastic IP addresses that you're using.
If you need additional Elastic IP addresses, then request a quota increase and configure the following settings:
- For AWS Services, select Amazon Elastic Compute Cloud (Amazon EC2).
- Choose EC2-VPC Elastic IPs.
- Choose Request increase at account-level.
I receive an error when I associate an Elastic IP address to one of my instances
When you associate an Elastic IP address to your instance, you might receive the following error:
"Elastic IP address could not be associated. You are not authorized to perform this operation"
To use the AllocateAddress and AssociateAddress APIs, your AWS Identity and Access Management (IAM) user or role must have permission.
Include the following permissions in the IAM policy that's attached to the IAM user or role that uses the APIs:
{ "Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:AllocateAddress",
"ec2:AssociateAddress"
],
"Resource": "*"
}
]
}
I receive an error when I release an Elastic IP address from my account
When you release an Elastic IP address from your account, you might receive the following error:
"Elastic IP address could not be released. You do not have permission to access the specified resource."
The preceding error message occurs when you release or disassociate an Elastic IP address that an AWS Managed Services (AMS) supported service uses.
To release an Elastic IP address that's associated with a service that AMS supports, delete the resource that's using it. For example, if you attached an Elastic IP address to a NAT Gateway, then delete the NAT Gateway. Then, you can release the Elastic IP address.