2 Answers
- Newest
- Most votes
- Most comments
3
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.
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
Relevant content
- asked 10 months ago
- AWS OFFICIALUpdated 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.