All Products
Search
Document Center

NAT Gateway:ModifyNatGatewaySpec

Last Updated:Aug 28, 2026

Upgrades a subscription Internet NAT gateway.

Operation description

  • This operation does not support downgrading a subscription Internet NAT gateway. You can only downgrade in the console.

  • When you upgrade a subscription Internet NAT gateway, an order is generated. After you complete the payment in the Order Center, the Internet NAT gateway is upgraded.

  • ModifyNatGatewaySpec is an asynchronous operation. After a request is sent, the request ID is returned but the Internet NAT gateway is not yet upgraded. The system upgrades the NAT gateway in the background. You can call the DescribeNatGateways operation to query the status of an Internet NAT gateway. - If an Internet NAT gateway is in the Modifying state, the NAT gateway is being upgraded. You can only query the NAT gateway but cannot perform other operations.

    • If an Internet NAT gateway is in the Available state, the Internet NAT gateway is upgraded.

  • You cannot repeatedly call the ModifyNatGatewaySpec operation to resize a pay-by-specification NAT gateway.

The size of an Internet NAT gateway determines its SNAT performance, including the maximum number of connections and the number of new connections per second. The size does not affect data throughput. The following table lists the SNAT performance metrics for each size.

Size Maximum number of connections Number of new connections per second
Small 10,000 1,000
Medium 50,000 5,000
Large 200,000 10,000

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The ID of the region where the Internet NAT gateway is deployed.

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

NatGatewayId

string

Yes

The ID of the Internet NAT gateway that you want to upgrade.

ngw-bp1uewa15k4iy5770****

Spec

string

Yes

The size of the Internet NAT gateway. Valid values:

  • Small: small

  • Middle: medium

  • Large: large

Middle

AutoPay

boolean

No

Whether to automatically complete the payment.

  • true: enables automatic payment. The payment is automatically completed.

  • false (default): disables automatic payment. If you select this option, you must go to the Order Center to complete the payment after an order is generated.

false

ClientToken

string

No

The client token that ensures the idempotence of the request.

You can use the client to generate the token value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters.

123e4567-e89b-12d3-a456-426655****

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

DBD4E4A2-786E-4BD2-8EB6-107FFC2B5B7D

Examples

Success response

JSON format

{
  "RequestId": "DBD4E4A2-786E-4BD2-8EB6-107FFC2B5B7D"
}

Error codes

HTTP status code

Error code

Error message

Description

400 NATGW_MODIFY_SPEC_SAME The specified Spec is same with now.
400 InvalidParameter.Spec.ValueNotSupported The specified Spec is not valid.
400 OperationFailed.SyncOrderToSub SyncOrderToSub error. The operation failed.
400 OperationFailed.QueryPrice Query price failed when create order. Failed to query the price when creating the order.
400 IncorrectStatus.NatGateway The status of NAT gateway is incorrect. The status of NAT gateway is incorrect.
500 OperationFailed.NoAvailableResource The Zone have no available resource.
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records.
404 InvalidNatGatewayId.NotFound The specified NatGatewayId does not exist in our records.
404 OperationUnsupported.PayByLcuNatModifySpec The spec of payByLcu nat is unsupported to modify. Pay-as-you-go NAT gateways cannot be resized.
404 Forbidden.ModifySpecToSpecialSpec You are not authorized to modify nat spec to special spec.
404 Forbidden.ModifySpecToSpecialSpecForNormalNat Normal NAT is not allowed to change to special spec, only enhanced nat allowed.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.