CreateDefaultSubnet - Amazon Elastic Compute Cloud


Creates a default subnet with a size /20 IPv4 CIDR block in the specified Availability Zone in your default VPC. You can have only one default subnet per Availability Zone. For more information, see Create a default subnet in the Amazon VPC User Guide.

Request Parameters

The following parameters are for this specific action. For more information about required and optional parameters that are common to all actions, see Common Query Parameters.


The Availability Zone in which to create the default subnet.

Type: String

Required: Yes


Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Type: Boolean

Required: No


Indicates whether to create an IPv6 only subnet. If you already have a default subnet for this Availability Zone, you must delete it before you can create an IPv6 only subnet.

Type: Boolean

Required: No

Response Elements

The following elements are returned by the service.


The ID of the request.

Type: String


Information about the subnet.

Type: Subnet object


For information about the errors that are common to all actions, see Common client error codes.



This example creates a default subnet in Availability Zone us-east-2a.

Sample Request &AvailabilityZone=us-east-2a &AUTHPARAMS

Sample Response

<CreateDefaultSubnetResponse xmlns=""> <requestId>12e2fb2e-e566-488a-926d-4655example</requestId> <subnet> <assignIpv6AddressOnCreation>false</assignIpv6AddressOnCreation> <availabilityZone>us-east-2a</availabilityZone> <availableIpAddressCount>4091</availableIpAddressCount> <cidrBlock></cidrBlock> <defaultForAz>true</defaultForAz> <ipv6CidrBlockAssociationSet/> <mapPublicIpOnLaunch>true</mapPublicIpOnLaunch> <state>available</state> <subnetId>subnet-111f7123</subnetId> <tagSet/> <vpcId>vpc-8eaaeabc</vpcId> </subnet> </CreateDefaultSubnetResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: