I'm writing a service which programmatically starts EC2 instances on demand. I want to give it the best chance of being able to start an instance at any time, minimizing fails due to lack of capacity. It doesn't matter what availability zone the instances run in within a region, just that I have the best chance of starting one.
I'm wondering, if I don't specify a placement object when using the runInstances method of the api, will it:
A) Run my new instances in any availability zone which has the capacity available
B) Randomly pick an availability zone and fail if there isn't any spare capacity there
C) Something else
My research shows people believing it's A) or B) but I can't find a definitive answer from aws.
If it's A) I guess I can make one call and leave it to aws to figure out if I can have the instance. If it's B) I guess I should pass in the availability zone and keep trying them all until I find one with spare capacity.
Thanks.