Got Unsupported RunInstances error.. but I didn't specify an Availability Zone

0

I got this error on CLI:

An error occurred (Unsupported) when calling the RunInstances operation: Your requested instance type (c5.2xlarge) is not supported in your requested Availability Zone (us-east-1e). Please retry your request by not specifying an Availability Zone or choosing us-east-1a, us-east-1b, us-east-1c, us-east-1d, us-east-1f.

This looks very reasonable. But how do I do not specify an Availability Zone? The command I ran which gave the above error just used us-east-1, not us-east-1e. Where's it getting us-east-1e? I did not specify that.

Here's the full command I ran: aws --output json ec2 run-instances --region=us-east-1 --client-token=some-client-token --image-id=ami-someimage-id --instance-type=c5.2xlarge --associate-public-ip-address --subnet-id=subnet-id --placement=GroupName=my-group-name

Associated support article also does not give an example of how to not specify an Availability Zone: https://aws.amazon.com/premiumsupport/knowledge-center/ec2-instance-type-not-supported-az-error/

howellz
asked 2 years ago507 views
2 Answers
3
Accepted Answer

By specifying a subnet you are choosing and availability zone. When a subnet is created you must specify the AZ that it is assigned to; so launching an instance in a subnet chooses that AZ.

profile pictureAWS
EXPERT
answered 2 years ago
  • Ah, yes, that looks right. I ran: aws --output json ec2 create-subnet --region=us-east-1 --vpc-id=some-vpc --cidr-block=1.0.0.0/1 & got output: { "Subnet": { "AvailabilityZone": "us-east-1e", ... } } which has that us-east-1e. So looks like I'll need to consider image location when creating / moving my subnet.

0

Hi Howellz, I think the error message is clear, and you ran specifying us-east-1.

aws --output json ec2 run-instances --region=us-east-1 --client-token=some-client-token --image-id=ami-someimage-id --instance-type=c5.2xlarge --associate-public-ip-address --subnet-id=subnet-id --placement=GroupName=my-group-name

Apparently you need to replace the region with one of the provided options: us-east-1a, us-east-1b, us-east-1c, us-east-1d, us-east-1f.

Can you try using one of those and see if it works?

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions

Relevant content