CreateNatGateway

1. API Description

This API (CreateNatGateway) is used to create a NAT gateway.

circle-info

Note

  • This API is an async API. A response is returned after the request is sent. You can call DescribeNatGateways to query the state of the NAT gateway. The RUNNING state means creating successfully.

  • Only pay-as-you-go NAT gateway creation is supported.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

regionId

Yes

String

Region ID.

vpcId

Yes

String

VPC network ID to which the NAT gateway belongs.

name

Yes

String

The name of the NAT gateway.

Length must be between 2 and 63 characters.

Available range: [2.0, +).

subnetIds

No

Array of String

Subnet ID list to which the NAT gateway belongs.

securityGroupId

No

String

ID of the security group.

If not specified, the security group associated with global VPC will be used by default.

resourceGroupId

No

String

Resource Group ID

If not specified, it will belong to the default resource group.

tags

No

Bound tags when creating the NAT gateway.

Tag keys must be unique.

3. Output Parameters

Parameter Name
Type
Description

requestId

String

The unique request ID, which is returned for each request.

RequestId is required for locating a problem.

orderNumber

String

Order number.

natGatewayId

String

The unique ID of the NAT gateway.

4. Code Example

Create a NAT gateway.

5. Developer Resources

Zenlayer Cloud API 2.0 integrates SDKs,to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

HTTP Status Code
Error Code
Description

404

INVALID_REGION_NOT_FOUND

Specified availability zone does not exist.

404

INVALID_VPC_NOT_FOUND

The global VPC does not exist.

404

INVALID_SUBNET_NOT_FOUND

Subnet does not exist.

400

OPERATION_DENIED_NAT_SUBNET_CONFLICT

Subnet is associated already.

400

OPERATION_DENIED_SUBNET_STATUS

Subnet state is not supported.

400

OPERATION_DENIED_SUBNET_NAT_CONFLICT

Subnet is associated with a NAT gateway already.

404

INVALID_EIP_NOT_FOUND

Elastic IP does not exist.

400

OPERATION_DENIED_EIP_IS_NOT_UN_ASSIGN

Elastic IP is not in unassigned state.

400

OPERATION_DENIED_SNAT_ENTRY_COUNT_LIMIT

The number of SNAT entries is limited.

400

OPERATION_DENIED_DNAT_ENTRY_COUNT_LIMIT

The number of DNAT entries is limited.

400

OPERATION_DENIED_SUBNET_TYPE_NOT_SUPPORT

Operations on subnets with such IP stack type is not supported.

404

INVALID_SECURITY_GROUP_NOT_FOUND

The specified security group does not exist.

Last updated