aws ec2 create-default-subnet
Creates a default subnet with a size /20 IPv4 CIDR block in the specified Availability Zone in your default VPC. AWS CLI reference
1 example 4 options Its page in the AWS CLI reference
Examples
To create a default subnet
The following create-default-subnet example creates a default subnet in Availability Zone us-west-2a.
aws ec2 create-default-subnet --availability-zone us-west-2aIdentify--availability-zoneThe Availability Zone in which to create the default subnet.Its output
{
"Subnet": {
"AvailabilityZone": "us-west-2a",
"Tags": [],
"AvailableIpAddressCount": 4091,
"DefaultForAz": true,
"Ipv6CidrBlockAssociationSet": [],
"VpcId": "vpc-1a2b3c4d",
"State": "available",
"MapPublicIpOnLaunch": true,
"SubnetId": "subnet-1122aabb",
"CidrBlock": "172.31.32.0/20",
"AssignIpv6AddressOnCreation": false
}
}For more information, see Work with your default VPC and default subnets in the Amazon VPC User Guide.
Options
--availability-zone-idThe ID of the Availability Zone.--availability-zoneThe Availability Zone in which to create the default subnet.--dry-runChecks whether you have the required permissions for the action, without actually making the request, and provides an error response.--ipv6-nativeIndicates whether to create an IPv6 only subnet.