Interview Prep/AWS/EC2, Auto Scaling and Load Balancing

`InsufficientInstanceCapacity: We currently do not have sufficient m5.large capacity in the Availability Zone you requested (us-east-1a).`

BeginnerTroubleshootingEC2, Auto Scaling and Load Balancing
Answer

Likely causes → AWS has no spare capacity for that instance type in that AZ right now. Your account is fine; this is not a quota problem.

Diagnose →

aws ec2 describe-instance-type-offerings --location-type availability-zone \
  --filters Name=instance-type,Values=m5.large --region us-east-1
aws autoscaling describe-scaling-activities --auto-scaling-group-name web-asg --max-items 5

Fix →

  1. Retry in a few minutes or launch in another AZ
  2. Try a similar type (m6i.large, m5a.large, m7i.large)
  3. For an ASG, use a mixed instances policy with several types and subnets in every AZ

Prevent → Never pin critical workloads to one type in one AZ. For events where you know you will need capacity, buy an On-Demand Capacity Reservation.

aws All AWS questions Roadmap: AWS core services

More on EC2, Auto Scaling and Load Balancing