You've reached your AWS account's vCPU quota limit for EC2 instances. AWS enforces soft limits on the number of vCPUs you can use in a region. This error occurs when trying to launch an instance that would exceed your current quota.
AWS uses a quota system to manage resource capacity across regions and instance types. Each AWS account has a default vCPU limit (typically 5 vCPUs for On-Demand Standard instances). When Terraform attempts to create an EC2 instance, AWS checks if the instance type's vCPUs would exceed your account's remaining quota. If it would, the VcpuLimitExceeded error is returned. This is not a permanent restriction—AWS allows you to request quota increases.
Navigate to the AWS Service Quotas console to see your current limits:
1. Log into your AWS account
2. Go to Service Quotas (search in AWS Console)
3. Select Amazon Elastic Compute Cloud (Amazon EC2)
4. Search for quotas like "Running On-Demand Standard" or your instance type
5. Note the "Quota value" (current limit) and "Usage" (vCPUs in use)
The instance type in your Terraform config belongs to an instance family. For example:
- t2.micro (1 vCPU) → Standard family
- t3.large (2 vCPUs) → Standard family
- m5.xlarge (4 vCPUs) → Standard family
- c5.2xlarge (8 vCPUs) → Standard family
Verify the family quota has enough capacity: Quota Value > Usage + Required vCPUs
To increase your quota, go to AWS Service Quotas console:
1. Open Service Quotas console
2. Select Amazon EC2
3. Find the quota matching your instance type (e.g., "Running On-Demand Standard (A, C, D, H, I, M, R, T, Z) instances")
4. Click the quota name
5. Click Request quota increase
6. Enter the new desired value
7. Click Request
AWS typically approves vCPU increases within hours. You can also request via AWS Support Center for expedited processing.
Quota codes for CLI:
- Standard instances: L-1216C47A
- All Standard instances: L-34B43A08
Using AWS CLI:
aws service-quotas request-service-quota-increase \
--service-code ec2 \
--quota-code L-1216C47A \
--desired-value 20While waiting for quota increase approval, use a smaller instance type that fits within your current quota:
# Current failing configuration (requires 4 vCPUs)
resource "aws_instance" "example" {
instance_type = "m5.xlarge" # 4 vCPUs
}
# Workaround: use smaller type (requires 1 vCPU)
resource "aws_instance" "example" {
instance_type = "t3.micro" # 1 vCPU
}This lets you continue development. Once your quota increase is approved, change back to the desired instance type.
AWS quotas are regional. If you need the instance immediately, try launching in a different region:
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}
provider "aws" {
region = "us-east-1" # Try different region
}
resource "aws_instance" "example" {
instance_type = "m5.xlarge"
# ... rest of config
}Check your quota in the target region first via Service Quotas console.
If Spot instances meet your needs, they have a separate quota that may be higher:
resource "aws_instance" "example" {
instance_type = "m5.xlarge"
instance_market_options {
market_type = "spot"
}
spot_type = "one-time"
}Note: Spot instances can be interrupted by AWS and are cheaper but less reliable. They're ideal for fault-tolerant, non-critical workloads.
Once AWS approves your quota increase:
1. Verify the new quota value in Service Quotas console
2. Check that your Terraform configuration is correct:
resource "aws_instance" "example" {
instance_type = "m5.xlarge"
# ... other configuration
}3. Run Terraform again:
terraform plan
terraform applyIf the instance launches successfully, confirm with AWS CLI:
aws ec2 describe-instances --filters "Name=instance-state-name,Values=running"Account-level vs Regional quotas:
vCPU quotas are regional. A new AWS account typically has 5 vCPUs for On-Demand Standard instances per region. This is different from other quotas (security groups, VPCs) that may be global.
Instance family grouping:
AWS groups instance types by family. Some important families:
- Standard: A, C, D, H, I, M, R, T, Z - general purpose, web servers, small databases
- Compute optimized: C-series - high-performance computing
- GPU: g3, p3, p4 - machine learning, graphics
- Memory optimized: r5, r6, x1, z1 - databases, caches
Each family may have its own quota. Request increases for your specific family.
Quota increase timelines:
- Most increases are approved within 2-4 hours
- Large increases (100+ vCPUs) may require AWS support review (1-2 days)
- For time-sensitive workloads, contact AWS Support for expedited approval
Cost implications:
Larger instance types cost more per hour. Plan your quota increase based on actual needs, not just your infrastructure requirements.
Terraform best practices:
- Use terraform plan before apply to verify all resources
- Set up separate AWS accounts/regions for dev, staging, and production to avoid quota conflicts
- Use tags to track which instances consume your quota
Error: Error installing helm release: cannot re-use a name that is still in use
How to fix "release name in use" error in Terraform with Helm
Error: Error creating GKE Cluster: BadRequest
BadRequest error creating GKE cluster in Terraform
Error: External program failed to produce valid JSON
External program failed to produce valid JSON
Error: Unsupported argument in child module call
How to fix "Unsupported argument in child module call" in Terraform
Error: network is unreachable
How to fix "network is unreachable" in Terraform