CRITICAL

How to Fix AWS EC2 Instance Limit Exceeded Error (2025)

Quick Fix Summary

TL;DR

Request an immediate vCPU limit increase via the AWS Support Center or Service Quotas console.

AWS enforces default limits (quotas) on the number of EC2 instances and vCPUs you can launch per region. The EC2InstanceLimitExceeded error occurs when you attempt to launch an instance that would exceed your current, region-specific limit.

Diagnosis & Causes

  • Launching instances beyond your vCPU On-Demand limit.
  • Auto Scaling group scaling beyond current quota.
  • Spike in demand from new deployments or scaling events.
  • Using instance types with high vCPU counts (e.g., c5.24xlarge).
  • Accumulated instances from previous launches not terminated.
  • Recovery Steps

    1

    Step 1: Diagnose Your Current Limits and Usage

    First, identify which specific limit you've hit and your current usage. Use the AWS CLI to check Service Quotas for EC2.

    bash
    # List all EC2-related quotas for your region
    aws service-quotas list-service-quotas --service-code ec2 --region us-east-1
    # Check your current On-Demand Instance usage (vCPUs)
    aws ec2 describe-account-attributes --attribute-names max-instances max-elastic-ips vpc-max-elastic-ips --region us-east-1
    2

    Step 2: Terminate Unnecessary Instances (Immediate Relief)

    If you have non-critical instances (e.g., old test instances, stopped instances that count towards the limit), terminate them to free up capacity immediately.

    bash
    # List all running instances with key details
    aws ec2 describe-instances --query 'Reservations[].Instances[].[InstanceId, State.Name, Tags[?Key==`Name`].Value|[0]]' --output table --region us-east-1
    # Terminate a specific instance (REPLACE i-1234567890abcdef0)
    aws ec2 terminate-instances --instance-ids i-1234567890abcdef0 --region us-east-1
    3

    Step 3: Request a Limit Increase via AWS Console (Primary Method)

    For production recovery, request a quota increase through the Service Quotas console. This is the standard, supported path.

    plaintext
    1. Open the AWS Service Quotas console.
    2. Navigate to 'AWS services' and select 'Amazon Elastic Compute Cloud (Amazon EC2)'.
    3. Find the relevant quota (e.g., 'Running On-Demand Standard (A, C, D, H, I, M, R, T, Z) instances').
    4. Click 'Request quota increase'.
    5. Enter the new limit value. Justify with business impact (e.g., 'Production outage due to scaling event').
    6. Submit. Support typically responds within a few hours for business-critical cases.
    4

    Step 4: Request a Limit Increase via AWS CLI (Automation)

    For automation or if console access is limited, you can request increases via CLI. Note: You still need to provide a justification.

    bash
    # Request increase for L-1216C47A (Running On-Demand Standard Instances)
    aws service-quotas request-service-quota-increase --service-code ec2 --quota-code L-1216C47A --desired-value 256 --region us-east-1
    5

    Step 5: Create a Critical Severity Support Case (For Urgent Issues)

    If the business impact is severe (e.g., production site down), create a critical severity support case to expedite the quota increase review.

    plaintext
    1. Go to the AWS Support Center.
    2. Click 'Create case'.
    3. Select 'Service limit increase'.
    4. Choose 'Critical' severity if your service is down.
    5. Fill in the limit details from Step 1.
    6. In description, state: 'Production outage due to EC2InstanceLimitExceeded. Immediate limit increase required to restore service.'
    6

    Step 6: Implement Preventive Controls

    After recovery, implement AWS Budgets, CloudWatch Alarms, and tagging strategies to prevent future surprises.

    bash
    # Create a CloudWatch Alarm for EC2 Instance Count
    aws cloudwatch put-metric-alarm --alarm-name EC2-Instance-Count-High --metric-name InstanceCount --namespace AWS/EC2 --statistic Maximum --period 300 --threshold 80 --comparison-operator GreaterThanThreshold --dimensions Name=InstanceType,Value=m5.large --evaluation-periods 1 --alarm-actions arn:aws:sns:us-east-1:123456789012:ops-team

    Architect's Pro Tip

    "For urgent, business-critical increases, call AWS Support directly if you have Enterprise Support. A phone call can trigger an immediate review of your pending quota request."

    Frequently Asked Questions

    How long does an AWS EC2 limit increase take?

    Standard requests are processed within 24-48 hours. For critical production outages, creating a high-severity support case can reduce this to 2-8 hours. Business and Enterprise Support plans receive faster responses.

    Do stopped EC2 instances count towards the limit?

    Yes. The primary limit is on the total number of vCPUs for all instances in a 'running' or 'stopped' state. Only 'terminated' instances free up capacity.

    Can I use Spot Instances or other families if I hit an On-Demand limit?

    Potentially, yes. Limits are often specific to instance families (Standard, GPU, etc.). Check your Service Quotas console. Spot Instances have separate, pooled limits but can provide immediate, cost-effective capacity during a limit crisis.

    Related AWS Guides