Table of Contents
The Error
Error creating EIP: AddressLimitExceeded: The maximum number of addresses has been reached
What Causes This
You’ve hit the AWS Elastic IP quota (default 5 per region). NAT Gateways, bastions, and public instances all consume EIPs.
How to Fix It
Solution 1: Release Unused EIPs
aws ec2 describe-addresses --query 'Addresses[?AssociationId==null].AllocationId' --output text | \
xargs -n1 aws ec2 release-address --allocation-id
Solution 2: Request Quota Increase
aws service-quotas request-service-quota-increase \
--service-code ec2 --quota-code L-0263D0A3 --desired-value 20
Solution 3: Use ALB Instead of Per-Instance EIPs
resource "aws_lb" "web" {
load_balancer_type = "application"
subnets = aws_subnet.public[*].id
}
Prevention Tips
- Pin provider versions — avoid surprise breaking changes
- Use CI/CD — catch errors before they hit production
- Test with
terraform plan— always review before applying - Keep Terraform updated — newer versions have better error messages
- Use
terraform validate— catches syntax errors early
Hands-On Courses
- Terraform for Beginners on CopyPasteLearn
- Terraform By Example — practical code examples
- Terraform Cheat Sheet — quick reference for all commands
Related Articles
- Terraform Troubleshooting - Common Errors and Solutions
- Terraform Enabling and Using Debugging
- Debugging with TFLint
Conclusion
This error is common and fixable. Follow the solutions above, and check our Terraform course for hands-on training that covers real-world troubleshooting scenarios.

