Reputation: 343
I have seem the following error during stack creation in number of AWS provided Cloud formation script. Any idea why its generating VPC error?
Error message: CREATE_FAILED AWS::EC2::Instance WindowsServer No subnets found for the default VPC 'vpc-aaaaaaa'. Please specify a subnet.
Here is the template: https://s3.amazonaws.com/cloudformation-templates-us-east-1/Windows_Roles_And_Features.template
Upvotes: 6
Views: 8969
Reputation: 83537
For my project, I had to create a AWS::RDS::DBSubnetGroup
and add DBSubnetGroupName
to my AWS::RDS::DBInstance
resource to reference it.
Upvotes: 0
Reputation: 375
I was facing the same problem and the below steps helped me.
Used this command on my shell to create a default subnet
aws ec2 create-default-subnet --availability-zone us-east-2a
For details please visit this documentation page by Amazon
Upvotes: 7
Reputation: 269490
The template works correctly (I just tried it in my account, in the Sydney region).
It would appear that the problem lies in your Default VPC, which is created when your AWS account is setup. It has a CIDR range of 172.31.0.0/16
and should have one Public Subnet in each of your Availability Zones.
Go to the VPC Management Console, go to the Subnets view, then change the "Filter by VPC" selector in the top-left to the Default VPC (normally un-named, so choose it via CIDR range). Make sure that you have a subnet in each Availability Zone.
If they are missing, you can create them. Make sure you turn on Modify Auto-Assign Public IP. Alternatively, contact AWS Support and ask them to fix/recreate your Default VPC.
Upvotes: 6