Skip to content
AWS EC2 📅 2026-02-03

Troubleshoot AWS EC2 'Error Code: InstanceLimitExceeded' Launch Failure

When attempting to provision new EC2 instances, encountering the InstanceLimitExceeded error indicates a critical blocker. This error signifies that your AWS account has reached its service quota for running EC2 instances within a specific region or for particular instance families. This guide provides immediate, actionable mitigation strategies and long-term architectural solutions to restore your deployment capabilities.

🚨 Symptoms & Diagnosis

You will encounter the following error signatures when your EC2 launch fails:

Error Code: InstanceLimitExceeded
You have requested more instances than your current instance limit allows.
aws ec2 run-instances: An error occurred (InstanceLimitExceeded) when calling the RunInstances operation: You have requested more instances than your current instance limit of 20 allows.
StateReason: {"Code":"InstanceLimitExceeded","Message":"You have requested more instances than your current instance limit allows."}

Root Cause: This error primarily stems from reaching the per-region vCPU quota for On-Demand instances (defaulting to 20 vCPUs/region across all instance types), or potentially an instance family-specific limit. It can also temporarily occur if recently terminated instances are still being factored into your quota.


🛠️ Solutions

Immediate Mitigation: Terminate Idle Instances & Check Usage

To quickly free up quota, identify and terminate any idle or unnecessary EC2 instances currently running in the affected region. After termination, verify your updated limits via the AWS CLI.

Immediate Mitigation: Terminate Idle Instances & Check Usage

This strategy offers a rapid method to recover vCPU quota, allowing for urgent deployments.

  1. List all running instances in your current region to pinpoint candidates for termination.
  2. Terminate any identified unused instances.
  3. Allow 2-5 minutes for AWS to release the vCPU quota from the terminated resources.
  4. Attempt your EC2 instance launch again.
  5. Verify your current service quotas and usage to confirm the quota release.
# 1. List running instances by ID, Type, and State in your current region
aws ec2 describe-instances --filters "Name=instance-state-name,Values=running" --query 'Reservations[*].Instances[*].[InstanceId,InstanceType,State.Name]' --output table

# 2. Terminate a specific instance (replace i-1234567890abcdef0 with the actual instance ID)
!!! warning "Data Loss Warning: Terminating an EC2 instance is a destructive operation that cannot be easily undone. Ensure you have appropriate backups and are targeting the correct, unused resource."
aws ec2 terminate-instances --instance-ids i-1234567890abcdef0

# 5. Check current EC2 running instance limits and usage post-termination
aws service-quotas list-service-quotas --service-code ec2 --query 'Quotas[?QuotaName==`Running On-Demand Standard (A, C, D, H, I, M, R, T, Z) instances` || QuotaName==`Running On-Demand All instance types`].[QuotaName,Value,UsageMetric]' --output table

Best Practice Fix: Request Quota Increase

For sustained production scaling and preventing recurring InstanceLimitExceeded errors, the recommended long-term solution is to formally request a service quota increase. This can be done through the AWS Service Quotas console or programmatically via the AWS CLI/API.

Best Practice Fix: Request Quota Increase

This is the definitive, production-grade method for scaling your AWS infrastructure beyond default account limits.

  1. Check your current vCPU quota for running On-Demand instances in the relevant region.
  2. Submit a request for a quota increase to your desired vCPU value. This can be initiated directly via the Service Quotas API or by creating a support case.
  3. Monitor the status of your quota increase request. You can track this in the AWS console or using aws support describe-cases.
  4. Once the request is approved and the quota has been updated, proceed with launching your instances.
# 1. Check current quota details for Running On-Demand Standard instances (L-1216C47A is the Quota Code)
# Replace us-east-1 with your target region.
aws service-quotas get-service-quota --service-code ec2 --quota-code L-1216C47A --region us-east-1

# 2. Request a quota increase (requires AWS CLI v2.13+ and 'servicequotas:RequestServiceQuotaIncrease' IAM permission)
# This example requests an increase to 50 vCPUs in us-east-1. Adjust 'desired-value' and 'region' as needed.
aws service-quotas request-service-quota-increase --service-code ec2 --quota-code L-1216C47A --desired-value 50 --region us-east-1

# Alternative: Create a support case via CLI for more complex requests or if direct quota increase fails.
# This requires 'support:CreateCase' IAM permission.
aws support create-case \
    --subject "EC2 Instance Limit Increase for Production Autoscaling" \
    --communication-body "Request increase from 20 to 100 vCPUs in us-east-1 for production autoscaling, primarily for m5.large and c5.xlarge instance types. Current projected usage demands 75 vCPUs." \
    --category "service-limit-increase" \
    --service-code "Amazon Elastic Compute Cloud" \
    --item-id "L-1216C47A" # Optional: Specify the quota code if known

Workaround: Switch Regions or Instance Types

If an immediate quota increase is not feasible, or you need to deploy critical resources without delay, consider launching instances in an alternate AWS region or by utilizing a different instance family/type that currently has available capacity.

Immediate Mitigation: Switch Regions or Instance Types

This approach offers a rapid bypass for quota limitations when a permanent increase is pending or not immediately required for your deployment strategy.

  1. List service quotas across various regions or for different instance types to identify where capacity is available.
  2. Launch your EC2 instances in an alternate region or using a different instance type that is not currently constrained by quota limits.
  3. Update your infrastructure-as-code (IaC) templates or deployment scripts to reflect the new region or instance type.
# 1. List quotas for specific instance types (e.g., t3, m5) in a region to assess availability
# This helps identify which instance families might have available quota.
aws service-quotas list-service-quotas --service-code ec2 --query 'Quotas[?contains(QuotaName,`t3`) || contains(QuotaName,`m5`)].QuotaName' --region us-east-1 --output table

# 2. Launch instance in a different region (e.g., us-west-2)
# Replace ami-0abcdef1234567890 with a valid AMI ID for us-west-2 and MyKeyPair with your key pair name.
aws ec2 run-instances --image-id ami-0abcdef1234567890 --count 1 --instance-type t3.micro --key-name MyKeyPair --region us-west-2

🧩 Technical Context (Visualized)

The AWS EC2 Service Quotas subsystem is a critical control plane component that enforces account-specific, per-region limits on the aggregate vCPUs consumed by running On-Demand instances. By default, most new AWS accounts are allocated a limit of 20 vCPUs per region, which applies across all instance types (e.g., two m5.xlarge instances at 4 vCPUs each, plus three t3.medium instances at 2 vCPUs each, would consume 14 vCPUs). When an aws ec2 run-instances API call is initiated, the Service Quotas subsystem performs a real-time check of the current vCPU usage against the allocated regional limit before authorizing the instance launch.

graph TD
    A[User requests EC2 instance launch] --> B{"AWS CLI / SDK / Console"};
    B --> C[EC2 RunInstances API Call];
    C --> D[AWS Service Quotas Subsystem];
    D -- 1. Query current vCPU usage --> E[Current Running Instances & vCPUs];
    D -- 2. Query account's allocated quota --> F[Service Quota for Region];
    E & F --> G{"Is (Current Usage + New vCPUs) > Quota?"};
    G -- Yes --> H[Return InstanceLimitExceeded Error];
    G -- No --> I[Proceed with EC2 Instance Provisioning];
    H --> J(EC2 Launch Fails);
    I --> K(EC2 Instance Launched Successfully);

✅ Verification

After implementing any of the solutions, it is crucial to verify that your EC2 quotas have been successfully updated or that new instances can now be launched without error.

# Verify current EC2 service quotas, their applied values, and usage metrics for a specific region
aws service-quotas list-service-quotas --service-code ec2 --region us-east-1 --query 'Quotas[?QuotaName==`Running On-Demand Standard (A, C, D, H, I, M, R, T, Z) instances`].{Quota:QuotaName,Applied:Value,Used:UsageMetric}' --output table

# Check instance limits specific to instance types (these may differ from the aggregated vCPU quota)
aws ec2 describe-instance-limits --region us-east-1 --query 'InstanceLimits[*].[InstanceType,Limit,Used]' --output table

# Perform a dry-run instance launch to test if an instance can be started without actual provisioning
# Replace ami-0abcdef1234567890 with a valid AMI ID for us-east-1.
aws ec2 run-instances --image-id ami-0abcdef1234567890 --count 1 --instance-type t3.micro --dry-run --region us-east-1

📦 Prerequisites

To effectively troubleshoot and resolve InstanceLimitExceeded errors, ensure your environment and AWS account have the following prerequisites:

  • AWS CLI v2.13+: Installed and configured with appropriate credentials.
  • IAM Permissions: Required permissions include ec2:Describe*, servicequotas:List*, servicequotas:RequestServiceQuotaIncrease, and support:CreateCase.
  • AWS Account Access: Administrator access or equivalent elevated permissions to your AWS account.