All Products
Search
Document Center

NAT Gateway:ModifyNatGatewayAttribute

更新时间:Jan 13, 2026
This topic is generated by a machine translation engine without any human intervention. ALIBABA CLOUD DOES NOT GUARANTEE THE ACCURACY OF MACHINE TRANSLATED CONTENT. To request a human-translated version of this topic or provide feedback on this translation, please include it in the feedback form.

Modifies the name and description of a NAT gateway.

Operation description

Description

You can call this operation to query an Internet NAT gateway or a virtual private cloud (VPC) NAT gateway. The term NAT gateway in this topic refers to both NAT gateway types.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:ModifyNatGatewayAttributeupdate
*NatGateway
acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the NAT gateway.

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

cn-hangzhou
NatGatewayIdstringYes

The ID of the NAT gateway.

ngw-2ze0dcn4mq31qx2jc****
NamestringNo

The name of the NAT gateway.

The name must be 1 to 128 characters in length and cannot start with http:// or https://.

nat123
DescriptionstringNo

The description of the NAT gateway.

The description must be 1 to 128 characters in length, and cannot start with http:// or https://.

Description
IcmpReplyEnabledbooleanNo

Specifies whether to enable the Internet Control Message Protocol (ICMP) non-retrieval feature. Valid values:

  • false (default)
  • true
false
EipBindModestringNo

Modifies the mode in which the EIP is associated with the NAT gateway. The value can be empty or NAT, which specifies the NAT mode.

Note
  • You can only change MULTI_BINDED to NAT. You cannot change NAT to MULTI_BINDED. For more information about the MULTI_BINDED mode, see CreateNatGateway .

  • When you change the association mode, your network may be interrupted for seconds. The duration increases with the number of EIPs. You can change the association mode for at most 5 EIPs at the same time. We recommend changing the association mode during off-peak hours.

  • After the association mode is changed to NAT, the Internet NAT gateway is compatible with an IPv4 gateway. If an EIP is associated with a NAT gateway in NAT mode, the EIP occupies a private IP address of the vSwitch to which the NAT gateway belongs. Ensure the vSwitch has sufficient private IP addresses for EIPs to be associated with the NAT gateway.

NAT
EnableSessionLogbooleanNo

Whether to enable session logging, with values:

  • true: Session logging is enabled.
  • false: Session logging is disabled.
true
LogDeliveryobjectNo

Session log configuration information.

LogDeliveryTypestringNo

Session log write type. Value: sls, Alibaba Cloud Log Service SLS.

sls
LogDestinationstringNo

Session log write address. Value: acs:log:${regionName}:${projectOwnerAliUid}:project/${projectName}/logstore/${logstoreName}

acs:log:cn-hangzhou:0000:project/nat_session_log_project/logstore/session_log_test

Response parameters

ParameterTypeDescriptionExample
object

The request ID.

RequestIdstring

The request ID.

AB5F62CF-2B60-4458-A756-42C9DFE108D1

Examples

Sample success responses

JSONformat

{
  "RequestId": "AB5F62CF-2B60-4458-A756-42C9DFE108D1"
}

Error codes

HTTP status codeError codeError messageDescription
400UnsupportedFeature.PrivateLinkModeThe feature of %s is not supported.The feature of reverse access is not supported.
400IncorrectStatus.NATGWNATGW status is invalid.The NAT gateway is in an invalid state.
400ExclusiveParam.%sAnd%sThe param of %s and %s are mutually exclusive.You cannot specify %s and %s at the same time.
400IncorrectStatus.NatGatewayThe status of natgateway is incorrect.The status of the NAT gateway is invalid.
400DependencyViolation.PrivateLinkModeThe specified resource of %s depends on %s, so the operation cannot be completed.The %s resource depends on %s.
400UnsupportedFeature.IcmpReplyEnabledThe feature of IcmpReplyEnabled is not supported.The value of IcmpReplyEnabled cannot be modified.
400InvalidParams.NotNullThe parameter must not be null, name or description or icmpReplyEnabledThe name, description, and ICMP proxy cannot be empty at the same time.
400InvalidParameter.Name.MalformedThe specified Name is not valid.The specified name format is invalid. Enter the name in the valid format.
400InvalidParameter.Description.MalformedThe specified Description is not valid.The specified description is invalid.
400UnsupportedFeature.IndirectConvertForVpcNatThe VPC NAT gateway is not support to change EIP bond type.The error message returned because the value of the EipBindMode parameter cannot be modified for a VPC NAT gateway.
400UnsupportedFeature.NormalNatModifyEipBindModeThe normal NAT gateway is not support to change EIP bond type.The value of EipBindMode cannot be modified for a standard NAT gateway.
400OperationDenied.EipBondTypeIsAlreadyNATThe EIP bond type is already NAT type.EipBindMode is already set to NAT.
400UnsupportedFeature.IndirectConvertForFwNatThe security protection enabled NAT gateway is not support change EIP bond type.The value of EipBindMode cannot be modified for an Internet NAT gateway for which the security protection feature is enabled.
400QuotaExceeded.EipNumForModifyEipBondTypeThe quota of %s is exceeded, binded: %s, quota: %s.The number of allowed EIPs reaches the upper limit when you modify the EIP association type.
400ResourceNotEnough.SwitchAvailableIpsThe available private Ip number is not enough in your subnet.The number of private IP addresses in the subnet is insufficient.
400UnsupportedFeature.VpcNatSecurityProtectionEnabledThe VPC NAT gateway is not supported to enable security protection.You cannot enable security protection for the VPC NAT gateway.
400OperationDenied.NatGatewayStatusInvalidThe NAT gateway status is invalid.The status of the NAT gateway does not support the operation.
400OperationDenied.EipStatusInvalidThe NAT gateway has EIP in invalid status.The EIP associated with the NAT gateway is in an invalid state.
400OperationDenied.SnatEntryStatusInvalidThe NAT gateway has SNAT entry in invalid status.The SNAT entry associated with the NAT gateway is in an invalid state.
400OperationDenied.DnatEntryStatusInvalidThe NAT gateway has DNAT entry in invalid status.The DNAT entry associated with the NAT gateway is in an invalid state.
400UnsupportedFeature.MutilBindedTypeNatEnableFwThe NAT with Mutil-Binded Eip bind type is not support enable firewall.You cannot enable firewall for the NAT gateway because EIPs are associated with the NAT gateway in Multi-Binded mode.
400Forbidden.FinancialLockedThe instance is locked due to outstanding payments.The instance has overdue payments.
400OperationFailed.PrivateLinkModeThe NAT gateway is not support to change PrivateLinkMode.The NAT gateway is not support to change PrivateLinkMode.
400IllegalParam.SessionLogDeliveryDestinationThe specified Delivery Destination is illegal.The specified Delivery Destination(SessionLogDeliveryDestination) is illegal.
400OperationFailed.LogDeliveryIsUnAuthorizedOperation failed because the user is not authorized to deliver NAT session log.The operation failed because you did not grant the NAT session log delivery permission
400IllegalParam.SessionLogDeliveryTypeThe specified Delivery Type is illegal.The specified delivery type parameter SessionLogDeliveryType is illegal.
400UnsupportedFeature.EnableSessionLogThe feature of EnableSessionLog is not supported.The NatGateway is spec mode, not supported open session log.
403Forbidden.ModifyEipBondTypeAuthentication is failed for modify EIP bond type.The value of EipBindMode cannot be modified.
404InvalidRegionId.NotFoundThe specified RegionId does not exist in our records.The specified region ID does not exist.
404InvalidNatGatewayId.NotFoundThe specified NatGatewayId does not exist in our records.The value of the NatGatewayId parameter is invalid.
500OperationFailed.ConfigSessionLogFailed to configure session log due to a temporary failure of the server.Failed to configure session log due to an internal service error.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-05-17The Error code has changedView Change Details
2024-05-07The Error code has changed. The request parameters of the API has changedView Change Details
2024-01-18API Description Update. The Error code has changedView Change Details
2023-03-01The Error code has changedView Change Details
2022-10-13The Error code has changed. The request parameters of the API has changedView Change Details