-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EIP: AddressLimitExceeded, nat gateways with count > than 2 #6018
Comments
Hi @ljankowski Are you sure about this By default, the EIP limit is 5 so you may have 3 IPs already allocated and then trying to create 3 more will give you that error I have just been able to create 5 new EIPs in my AWS account without any issues thanks Paul |
Hi Paul, We have few other addresses associated with instances, but no unassociated ones. So that's not it. I did some more testing and it looks like when you destroy environment and rebuild it with 3 AZs, then all works as you said. The problem exists, when you build with 2 AZs and then change the count from 2 to 3, then do plan and apply. In such situation it fails consistently. Thanks, |
Amazon only allows 5 EIPs per region, when in a VPC. This is both unassociated and associated ones. They do not list a limit anywhere for "unassociated" anywhere that I can find. http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html Its under The exception is being thrown by Amazon, not by terraform. You can find the exception details here: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html Which specifically states |
Thanks for the info on this @tecnobrat I am going to close this out for now as it corroborates my theory on hitting the EIP limit. If you raise the limit and find the same issue, please re-comment on this thanks Paul |
@tecnobrat actually I did some more tests and you are right about the limit. I have 3 IPs allocated for other purpose on that account in that region. When I use terraform to create vpc with 2 IPs, then all works fine. However, there's probably bug in AWS. I should probably report that to AWS. |
Open the Service Quotas console at https://console.aws.amazon.com/servicequotas/, enter Amazon EC2 in the search field, and choose Amazon Elastic Compute Cloud (Amazon EC2). Enter IP in the search field. From this page you can increase the limit of available EIPs. The changes are being applied during 30 minutes |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
When we try to allocate nat gateways per availability zone, when
var.zone_count
more than 2 as per below:the apply process fails with:
The problem is with order of operations.
As we use
count
to create nat gateways, I suspect terraform treats it as a one resource (and not 3).and tries to allocate all IPs before creating even single nat gateway. Snip from the plan:
AWS limits number of unallocated EIPs to 2 (there's a charge for all consecutive ones), thus process fails.
Is it possible to either:
aws_eip
resource to accept the charge and carry on;count
is being used. problem should disappear as soon as one of the other nat gateways get eip allocatedThanks,
Lukasz
The text was updated successfully, but these errors were encountered: