28

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?

Steve Chambers
  • 37,270
  • 24
  • 156
  • 208

3 Answers3

39

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".

The Onin
  • 5,068
  • 2
  • 38
  • 55
  • 1
    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. – rhytha mk Oct 29 '22 at 06:53
26

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.

Joshua Wolff
  • 2,687
  • 1
  • 25
  • 42
Ervin Szilagyi
  • 14,274
  • 2
  • 25
  • 40
  • 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. – Mark B Apr 09 '22 at 13:19
  • @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. – Ervin Szilagyi Apr 09 '22 at 13:25
  • 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". – Mark B Apr 09 '22 at 13:27
  • Noted, I rephrased it. – Ervin Szilagyi Apr 09 '22 at 13:28
  • Thanks for confirming. Have now released the unallocated IP addresses and the stack deploys without this error. – Steve Chambers Apr 10 '22 at 11:44
  • > 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? – Joshua D. Boyd Feb 13 '23 at 23:07
2

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.

Pii Huynh
  • 21
  • 1
  • 3