CreateSubnet
GET /?Action=CreateSubnet
Description
Creates a subnet in an existing VPC.
To create a subnet in a VPC, you have to provide the ID of the VPC and the CIDR block for the subnet (its network range). Once the subnet is created, you cannot modify its CIDR block.
The CIDR block of the subnet can be either the same as the VPC one if you create only a single subnet in this VPC, or a subset of the VPC one. In case of several subnets in a VPC, their CIDR blocks must no overlap. The smallest subnet you can create uses a /30 netmask (four IP addresses).
Body parameter
Required: false
Name: CreateSubnetRequest
Name | Description | Required | Schema | Default | Example |
---|---|---|---|---|---|
AvailabilityZone |
The name of the Availability Zone in which you want to create the subnet. |
false |
string |
||
CidrBlock |
The CIDR block for the subnet (for example, 10.0.0.0/24). |
true |
string |
||
VpcId |
The ID of the VPC. |
true |
string |
Responses
HTTP Code 200
HTTP Code | Description | Schema |
---|---|---|
200 |
CreateSubnetResult |
Response 200
Name | Description | Required | Schema | Default | Example |
---|---|---|---|---|---|
requestId |
The ID of the request. |
false |
string |
||
subnet |
Information about the newly created subnet. |
false |