45

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?

3 Answers 3

62

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!

3
  • 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, 2022 at 6:53
  • 2
    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! Oct 26, 2023 at 21:50
  • @Michael12345 very true
    – The Onin
    Oct 28, 2023 at 5:10
36

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.

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.
    – Mark B
    Apr 9, 2022 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. Apr 9, 2022 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 9, 2022 at 13:27
  • Noted, I rephrased it. Apr 9, 2022 at 13:28
  • Thanks for confirming. Have now released the unallocated IP addresses and the stack deploys without this error. Apr 10, 2022 at 11:44
6

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.