How to resolve "The maximum number of addresses has been reached" for AWS VPC Elastic IP addresses?
Asked Answered
G

3

53

I'm working with CDK/CloudFormation and recently started getting this error when attempting to create a new stack:

The maximum number of addresses has been reached.

Looking in the AWS Management Console, there is a limit of 40 VPC IP addresses and there are exactly 40 in the list - but some of these have neither an Associated Instance ID nor an Association ID set:

Elastic IP addresses

My understanding is the ones that have neither of these set aren't being used for anything so would like to make them usable to get past the error on stack creation. But unsure how to do this - would "Release Elastic IP address" do the trick or do they need to remain in the account but be marked as reusable in some other way?

Gonium answered 9/4, 2022 at 12:22 Comment(0)
C
38

The maximum number of addresses has been reached.

You get this error because you associate public IP addresses to your instances. As you may know, the number of public IPv4 ip addresses is limited. This means that AWS, by default, allows you to allocate at most 5 Elastic IPs per region. This is a soft limit, you can ask for an increase. There are ways around having to attach public IP addresses to everything, so it is not really recommended to ask for an increase.

But unsure how to do this - would "Release Elastic IP address" do the trick or do they need to remain in the account but be marked as reusable in some other way?

First you have to dissociate the IP address from the instance. Afterwards, you will be able to press Release Elastic IP address. So yes, that would do the trick.

Courtly answered 9/4, 2022 at 12:44 Comment(6)
Your statement on the limit of "5 public IPv4 addresses per region" is a bit misleading. It's 5 Elastic IPs per region. You can have many more public IPs, by enabling "assign public IP" in your VPC settings, but those are not static IPs dedicated to your account, you lose them when your EC2 instance shuts down, unlike Elastic IPs that are dedicated to your account once you allocate them.Abampere
@MarkB I absolutely agree with what you saying about having more than 5 public IP addresses. You can see that in the screen shot provided, there are EIP allocated to the instances. this is why I gave this answer.Courtly
I'm just saying you should rephrase your answer slightly. Instead of "5 public IPv4 addresses per region" it should be "5 Elastic IPs per region".Abampere
Noted, I rephrased it.Courtly
Thanks for confirming. Have now released the unallocated IP addresses and the stack deploys without this error.Gonium
> There are ways around having to attach public IP addresses to everything, so it is not really recommended to ask for an increase. Would you mind pointing in the direction of what to look for to reduce the need for elastic IPs?Weintraub
X
72

I'm working with AWS CDK and Kubernetes and I had to request a quota increase from 5 to 10, and I got it approved in 15 minutes.

Go to https://us-east-1.console.aws.amazon.com/servicequotas/home/services/ec2/quotas and search for "IP". Then, choose "EC2-VPC Elastic IPs".

Note the AWS region is included in the URL for this link - make sure you don't request a quota increase for the wrong region!

Xanthus answered 13/10, 2022 at 22:21 Comment(3)
Thank you for the above link, this saved me when i was migrating and wanted to retain the IP and ran out of IP's.Reck
Note the AWS region is included in the URL for this link - make sure you don't request a quota increase for the wrong region!Centralia
@Centralia very trueXanthus
C
38

The maximum number of addresses has been reached.

You get this error because you associate public IP addresses to your instances. As you may know, the number of public IPv4 ip addresses is limited. This means that AWS, by default, allows you to allocate at most 5 Elastic IPs per region. This is a soft limit, you can ask for an increase. There are ways around having to attach public IP addresses to everything, so it is not really recommended to ask for an increase.

But unsure how to do this - would "Release Elastic IP address" do the trick or do they need to remain in the account but be marked as reusable in some other way?

First you have to dissociate the IP address from the instance. Afterwards, you will be able to press Release Elastic IP address. So yes, that would do the trick.

Courtly answered 9/4, 2022 at 12:44 Comment(6)
Your statement on the limit of "5 public IPv4 addresses per region" is a bit misleading. It's 5 Elastic IPs per region. You can have many more public IPs, by enabling "assign public IP" in your VPC settings, but those are not static IPs dedicated to your account, you lose them when your EC2 instance shuts down, unlike Elastic IPs that are dedicated to your account once you allocate them.Abampere
@MarkB I absolutely agree with what you saying about having more than 5 public IP addresses. You can see that in the screen shot provided, there are EIP allocated to the instances. this is why I gave this answer.Courtly
I'm just saying you should rephrase your answer slightly. Instead of "5 public IPv4 addresses per region" it should be "5 Elastic IPs per region".Abampere
Noted, I rephrased it.Courtly
Thanks for confirming. Have now released the unallocated IP addresses and the stack deploys without this error.Gonium
> There are ways around having to attach public IP addresses to everything, so it is not really recommended to ask for an increase. Would you mind pointing in the direction of what to look for to reduce the need for elastic IPs?Weintraub
G
7

AWS limits 5 Elastic IPs for each region by default. So to increase that quota, you have to make a request.

Here is how to do that (follow their document at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#using-instance-addressing-limit):

Open the Service Quotas console at https://console.aws.amazon.com/servicequotas/.

On the Dashboard, choose Amazon Elastic Compute Cloud (Amazon EC2). If Amazon Elastic Compute Cloud (Amazon EC2) is not listed on the Dashboard, choose AWS services, enter EC2 in the search field, and then choose Amazon Elastic Compute Cloud (Amazon EC2).

On the Amazon EC2 service quotas page, enter IP in the search field. The limit is EC2-VPC Elastic IPs. If you have access to EC2-Classic, there is an additional limit, EC2-Classic Elastic IPs. For more information, choose the limit.

If you think your architecture warrants additional Elastic IP addresses, you can request a quota increase directly from the Service Quotas console.

Double-check your target region before click submit.

Hope that's help.

Grammar answered 2/3, 2023 at 8:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.