Reputation: 85
I accidentally deleted all the default subnets in aws,I want to recreate default subnets。I make CLI command: "aws ec2 create-default-subnet --availability-zone us-west-2a" ,but always get the error message "An error occurred (DefaultSubnetAlreadyExistsInAvailabilityZone) when calling the CreateDefaultSubnet operation: 'subnet-015c449cab525d947' is already the default subnet in us-west-2d." how to solve this problem?
Upvotes: 2
Views: 1250
Reputation: 31
To create default subnets, you need to use AWS CLI. Through AWS console you cannot create default subnets. Steps to create default subnet through AWS CLI:
Upvotes: 3
Reputation: 141
There is only one default subnet can exist in each availability zone, seems you already have yours on us-west-2a, login to you AWS account search for VPC > Subnets and delete what you have there, then you can re-create it with this command: ws ec2 create-default-subnet --availability-zone us-west-2a
check AWS document fore more info: https://aws.amazon.com/premiumsupport/knowledge-center/recreate-default-vpc/
Upvotes: 3