Create NAT Gateways

Last updated: 2019-11-29 16:13:57

1. API Description

This API (CreateNatGateway) is used to create an NAT gateway.
Domain for API request:

2. Input Parameters

The following request parameter list only provides API request parameters. Common request parameters need to be added when the API is called. For more information, refer to Common Request Parameters.

Parameter Name Required Type Description
natName Yes string NAT gateway name; supports 1-25 characters, including uppercase and lowercase English letters, numbers, and underscores.
vpcId Yes string Virtual private cloud ID or unified ID (unified ID is recommended). It can be queried via the DescribeVpcEx API.
maxConcurrent Yes int The upper limit of concurrent connection of NAT gateway, for example: 1000000, 3000000, 10000000. To learn more, please refer to Virtual Private Cloud Gateway Description.
bandwidth No int The maximum public network output bandwidth of the gateway (unit: Mbps), which is 100 Mbps by default. For more information, please refer to Virtual Private Cloud Gateway Description.
assignedEipSet.n No string One of the two elastic IP arrays bound to the gateway, assignedEipSet and autoAllocEipNum, must be passed at least, for example: assignedEipSet.0= For more information on elastic IP, please refer to Elastic IP.
autoAllocEipNum No int The number of elastic IPs for new requests. The system will generate several elastic IPs according to your needs. One of the assignedEipSet and autoAllocEipNum must be passed at least. For more information on elastic IP, please refer to Elastic IP.

3. Output Parameters

Parameter Name Type Description
code Int Error code. 0: Succeeded; other values: Failed
message string Error message
billId string Order ID. You can query the creation result by calling QueryNatGatewayProductionStatus API.

4. Error Codes

The following error code list only provides the business logic error codes for this API. For additional common error codes, refer to VPC Error Codes.

Error Code Description
InvalidVpc.NotFound This VPC does not exist. Please check the information entered. You can query the VPC via the DescribeVpcEx API.
InvalidNatGatewayName The NAT gateway name is invalid. It should contain 1-60 characters, including uppercase and lowercase letters, numbers, and underscores
NatGatewayLimitExceeded Reached the upper limit of NAT gateways. Please contact customer service to raise the quota. For more information on VPC resource restrictions, see VPC Service Limits

5. Example