All Products
Search
Document Center

Virtual Private Cloud:ModifyNatGatewayAttribute

Last Updated:Aug 29, 2024

Modifies the attributes 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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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:
    • The required resource types are displayed in bold characters.
    • 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

The mode in which the NAT gateway is associated with an elastic IP address (EIP). You can leave this parameter empty. If you want to specify a value for this parameter, set the value to NAT, which indicates that the NAT gateway is associated with the EIP in NAT mode.

**

Description

  • If EipBindMode is set to MULTI_BINDED when the NAT gateway is created, you can change the value of this parameter from MULTI_BINDED to NAT. If EipBindMode is set to NAT when the NAT gateway is created, you cannot change the value of this parameter from NAT to MULTI_BINDED. For more information about MULTI_BINDED, see CreateNatGateway .

  • When the mode in which the NAT gateway is associated with an EIP is being changed, a transient connection that lasts a few seconds may occur. If the number of EIPs with which the NAT gateway is associated increases, the transient connection lasts longer. You can change the mode only for a NAT gateway that is associated with up to five EIPs. We recommend that you change the mode during off-peak hours.

  • After the mode is changed to NAT, the Internet NAT gateway is compatible with the IPv4 gateway. However, if you associate an EIP with the NAT gateway, the EIP occupies one private IP address on the vSwitch of the NAT gateway. Make sure that the vSwitch has sufficient private IP addresses. Otherwise, the EIP fails to be associated with the NAT gateway.

NAT

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.
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.

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