I have a problem and I expect that someone help me.

I'm working with AWS and I have 2 VPC. The default VPC an another VPC created by me. Each VPC has 3 subnets in differents AZ (eu-west-1a, eu-west-1b and eu-west-1c).

I detected that, in default VPC, I can create/run a EC2 instance without specify which subnet. But, with non-default VPC i have to specify which subnet I will use.

In non-default VPC, is it possible create a EC2 without specify a subnet?

I'm interested create a CloudFormation template that create Ec2 instance in differents subnets for redundancy.

1 Answer 1


I think you can leverage the new Parameter support in Cloudformation to do this.


Get a list of all subnets in your VPC like this:

  "mySubnetIDs" : {
    "Description" : "Subnet IDs",
    "Type" : "List<AWS::EC2::Subnet::Id>"

Then pick the first (or Nth) ID, store that in a variable, and pass it to create instance.

See also:


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.