CreateVpc
Creates a virtual private cloud (VPC).
When you call this operation, take note of the following items:
-
You can specify only one CIDR block for each VPC.
-
After you create a VPC, you cannot change its CIDR block. However, you can add secondary IPv4 CIDR blocks to the VPC.
-
In each VPC, cloud services can use a maximum of 60,000 private IP addresses. You cannot increase the quota.
-
After you create a VPC, a vRouter and a route table are automatically created.
-
At most three user CIDR blocks can be added to a VPC. If a user CIDR block includes another user CIDR block, the one with the shorter subnet mask takes effect. For example, if both 10.0.0.0/8 and 10.1.0.0/16 are specified, only 10.0.0.0/8 takes effect.
-
CreateVpc is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the DescribeVpcAttribute operation to query the status of the task:
- If the VPC is in the Creating state, the VPC is being created.
- If the VPC is in the Created state, the VPC is created.
-
You cannot repeatedly call the DeleteRouteEntry operation to create default VPCs within a specific time period. However, you can repeatedly call this operation to create custom VPCs within a specific time period.
Request
Query Parameters
RegionId
The ID of the region to which the VPC belongs.
You can call the DescribeRegions operation to query the most recent region list.
cn-hangzhou
CidrBlock
The CIDR block of the VPC.
- You can specify one of the following CIDR blocks or their subsets as the primary IPv4 CIDR block of the VPC: 192.168.0.0/16, 172.16.0.0/12, and 10.0.0.0/8. These CIDR blocks are standard private CIDR blocks as defined by Request for Comments (RFC) documents. The subnet mask must be 8 to 28 bits in length.
- You can also use a custom CIDR block other than 100.64.0.0/10, 224.0.0.0/4, 127.0.0.0/8, 169.254.0.0/16, and their subnets as the primary IPv4 CIDR block of the VPC.
172.16.0.0/12
172.16.0.0/12
Ipv6CidrBlock
The IPv6 CIDR block of the VPC.
2408:XXXX:0:6a::/56
VpcName
The name of the VPC.
The name must be 1 to 128 characters in length and cannot start with http://
or https://
.
abc
EnableIpv6
Specifies whether to enable IPv6. Valid values:
- false (default)
- true
false
Description
The description of the VPC.
The description must be 1 to 256 characters in length and cannot start with http://
or https://
.
This is my first Vpc
ResourceGroupId
The ID of the resource group.
For more information about resource groups, see What is a resource group?
rg-acfmxazb4ph6aiy****
Tag
The tag of the resource.
Key
The key of tag N to add to the resource. You can specify at most 20 tag keys. The tag key cannot be an empty string.
The tag key can be at most 128 characters in length. It cannot start with aliyun
or acs:
, and cannot contain http://
or https://
.
FinanceDept
Value
The value of tag N to add to the resource. You can specify at most 20 tag values. The tag value can be an empty string.
The tag value can be up to 128 characters in length, but cannot contain http://
or https://
. The tag value cannot start with aliyun
or acs:
.
FinanceJoshua
DryRun
Specifies whether to perform a dry run, without performing the actual request. Valid values:
-
true: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the
DryRunOperation
error code is returned. - false (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.
false
UserCidr
The user CIDR block. Separate user CIDR blocks with commas (,). You can specify up to three user CIDR blocks.
For more information about user CIDR blocks, see the What is a user CIDR block?
section in VPC FAQ.
192.168.0.0/12
ClientToken
The client token that is used to ensure the idempotence of the request.
You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.
If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.
123e4567-e89b-12d3-a456-426655440000
Ipv6Isp
The type of the IPv6 CIDR block of the VPC. Valid values:
- BGP (default)
- ChinaMobile
- ChinaUnicom
- ChinaTelecom
If you are allowed to use single-ISP bandwidth, you can set the value to ChinaTelecom, ChinaUnicom, or ChinaMobile.
BGP
Ipv4IpamPoolId
The ID of the IP Address Manager (IPAM) pool of the IPv4 type.
ipam-pool-sycmt3p2a9v63i****
Ipv4CidrMask
EnableDnsHostname
Response
Body
{}
The ID of the created VPC.
VpcId
The ID of the created VPC.
vpc-bp15zckdt37pq72zv****
VRouterId
The ID of the vRouter that is automatically created by the system after the VPC is created.
vrt-bp1lhl0taikrteen8****
RequestId
The request ID.
0ED8D006-F706-4D23-88ED-E11ED28DCAC0
RouteTableId
The ID of the route table that is automatically created by the system after the VPC is created.
vtb-bp145q7glnuzdv****
ResourceGroupId
The resource group ID.
rg-acfmxazb4ph6aiy****