Create a VPC in the specified region.

Note the following before creating a VPC:
  • You must specify the IP address range of the VPC in the form of the CIDR block. You can use the standard private IP address ranges and their subnets as the IP address range of the VPC. The standard IP address ranges include 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. The default is 172.16.0.0/12.

  • The CIDR block cannot be modified after the VPC has been created.

  • The number of cloud product instances in each VPC cannot exceed 15,000.

  • A VRouter and a route table are automatically created after a VPC is created.

  • Up to three customer-side CIDR blocks can be added to a VPC. If a customer-side CIDR block is the subset of another, the one with the shorter netmask takes effect. Take 10.0.0.0/8 and 10.1.0.0/16 as an example, the customer-side CIDR block 10.0.0.0/8 takes effect.

Request parameters

Name Type Required Description
Action String Yes

The action to perform. Valid value:

CreateVpc

RegionId String Yes

The ID of the region where the VPC is created.

You can query the region ID by calling the DescribeRegions API.

CidrBlock String No

The IP address range of the VPC in the CIDR block form. You can use the following IP address ranges and their subnets:

  • 10.0.0.0/8
  • 172.16.0.0/12 (Default)
  • 192.168.0.0/16
VpcName String No

The name of the VPC.

The name can contain 2-128 characters including a-z, A-Z, 0-9, underlines, and hyphens but cannot start with http:// or https://.

Description String N

 The description of the VPC.

The description can contain 2-256 characters, but cannot start with http:// or https://.

ClientToken String No

A client token used to guarantee the idempotence of requests.

This parameter value is generated by the client and must be unique. It cannot exceed 64 ASCII characters.

UserCidr String No

The customer-side CIDR block. Separate multiple CIDR blocks by commas.

Response parameters

Name Type Description
RequestId String The ID of the request.
VpcId String The ID of the VPC.
VRouterId String The ID of the VRouter.
RouteTableId String The ID of the route table.

Examples

Request example

https://vpc.aliyuncs.com/?Action=CreateVpc
&RegionId=cn-hangzhou
&CidrBlock=10.10.0.0/24
&CommonParameters
Response example
  • XML format

    <? xml version="1.0" encoding="UTF-8"? >
    <CreateVpcResponse>
        <RequestId>0ED8D006-F706-4D23-88ED-E11ED28DCAC0</RequestId>
        <RouteTableId>vtb-bp145q7glnuzdvzu21pom</RouteTableId>
        <VRouterId>vrt-bp1lhl0taikrteen80oxx</VRouterId>
        <VpcId>vpc-bp15zckdt37pq72zvw3</VpcId>
    </CreateVpcResponse>
  • JSON format

    { 
        "RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0", 
        "RouteTableId": "vtb-bp145q7glnuzdvzu21pom", 
        "VRouterId": "vrt-bp1lhl0taikrteen80oxx", 
        "VpcId": "vpc-bp15zckdt37pq72zvw30k"
    }