Creates a NAT CIDR block for a VPC NAT gateway instance.
Operation description
The CreateNatIpCidr operation does not support concurrent creation of NAT IP CIDR blocks within the same NAT gateway.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vpc:CreateNatIpCidr |
create |
*NatGateway
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the NAT gateway instance to which the NAT CIDR block belongs. You can call the DescribeRegions operation to query the region ID. |
eu-central-1 |
| NatGatewayId |
string |
Yes |
The instance ID of the VPC NAT gateway for which you want to create the NAT CIDR block. |
ngw-gw8v16wgvtq26vh59**** |
| NatIpCidrName |
string |
No |
The name of the NAT CIDR block. The name must be 2 to 128 characters in length and must start with a letter or Chinese character. It can contain digits, periods (.), underscores (_), and hyphens (-). It cannot start with |
newcidr |
| NatIpCidrDescription |
string |
No |
The description of the NAT CIDR block. The description must be 2 to 256 characters in length and must start with a letter or Chinese character. It cannot start with |
mycidr |
| DryRun |
boolean |
No |
Specifies whether to perform a dry run. Valid values:
|
false |
| ClientToken |
string |
No |
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 ClientToken value can contain only ASCII characters. Note
If you do not specify this parameter, the system uses the RequestId of the API request as the ClientToken. The RequestId of each API request may be different. |
5A2CFF0E-5718-45B5-9D4D-70B3FF3898 |
| NatIpCidr |
string |
Yes |
The NAT CIDR block to create. The new CIDR block must meet the following conditions:
|
172.16.0.0/24 |
| RegionId |
string |
Yes |
The region ID of the NAT gateway instance to which the NAT CIDR block belongs. You can call the DescribeRegions operation to query the region ID. |
eu-central-1 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| NatIpCidrId |
string |
The instance ID of the NAT CIDR block. |
vpcnatcidr-gw8lhqtvdn4qnea**** |
| RequestId |
string |
The request ID. |
7021BEB1-210F-48A9-AB82-BE9A9110BB89 |
Examples
Success response
JSON format
{
"NatIpCidrId": "vpcnatcidr-gw8lhqtvdn4qnea****",
"RequestId": "7021BEB1-210F-48A9-AB82-BE9A9110BB89"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | IncorrectStatus.NatGateway | The status of %s [%s] is incorrect. | |
| 400 | OperationFailed.NatIpCidrInUse | The operation is failed because of %s. | |
| 400 | QuotaExceeded.NatIpCidr | The quota of %s is exceeded, usage %s/%s. | |
| 400 | OperationFailed.CreateNatIpCidrInVpcCidrBlock | The operation is failed because of Creating NatIpCidr in Vpc Cidr. | |
| 400 | OperationFailed.CreateNatIpCidrNotInUserCidr | The operation is failed because of Creating NatIpCidr not in UserCidr. | The operation failed because the NAT CIDR block does not fall within the user CIDR block. |
| 400 | ResourceAlreadyExist.NatIpCidr | The specified resource of %s is already exist. | |
| 400 | IllegalParamFormat.NatIpCidr | The param format of NatIpCidr is illegal. | The param format of NatIpCidr is illegal. |
| 404 | InvalidRegionId.NotFound | The specified RegionId does not exist in our records. | |
| 404 | ResourceNotFound.NatGateway | The specified resource of %s is not found. | |
| 404 | ResourceNotFound.VPC | The specified resource of %s is not found. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.