1

When creating an EC2 autoscaling group, it's possible to specify multiple subnets in different availability zones, so that the autoscaling group can start instances where there is capacity.

Is there a way to do a similar thing when using EC2 launch templates to launch instances from scratch? I would like to be able to specify a list of subnets, and then ask EC2 to launch an instance based on my launch template in whichever subnet has spare capacity for the type of instance in question.

However, because launch templates seem to require you to specify network interfaces, I can't see an obvious way of achieving this.

0

You don't have to specify all the fields in a launch template. If you leave Network Interfaces blank it will launch the instance in a subnet in your Default VPC.

Alternatively, you could just use a n AutoScaling Group (but I assume there's some reason that doesn't work for your use case since you already mentioned it above?)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.