edit-icon download-icon

CreateVpc

Last Updated: Apr 07, 2018

Description

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 must start with an English letter, but cannot start with http:// or https://.

The name can contain from 2 to 128 characters including a-z, A-Z, 0-9, underlines, and hyphens.

Description String No The description of the VPC.

The description must start with English letters, but cannot start with http:// or https://.

The description can contain from 2 to 256 characters.

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.

For more information, see How to ensure idempotence.

UserCidr String No

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

A maximum of three CIDR blocks are supported.

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.

Error codes

See VPC API Error Center.

Examples

Request example

  1. https://vpc.aliyuncs.com/?Action=CreateVpc
  2. &RegionID=cn-beijing
  3. &<CommonParameters>

Response example

XML format

  1. <CreateVpcResponse>
  2. <RequestId>461D0C42-D5D1-4009-9B6A-B3D5888A19A9</RequestId>
  3. <RouteTableId>vtb-25wm68mnh</RouteTableId>
  4. <VRouterId>vrt-25bezkd03</VRouterId>
  5. <VpcId>vpc-257gq642n</VpcId>
  6. </CreateVpcResponse>

JSON format

  1. {
  2. "RequestId": "461D0C42-D5D1-4009-9B6A-B3D5888A19A9",
  3. "RouteTableId": "vtb-25wm68mnh",
  4. "VRouterId": "vrt-25bezkd03",
  5. "VpcId": "vpc-257gq642n"
  6. }
Thank you! We've received your feedback.