All Products
Document Center

Elastic Compute Service:ConvertNatPublicIpToEip

Last Updated:Apr 11, 2024

Converts the public IP address of an Elastic Compute Service (ECS) instance located in a virtual private cloud (VPC) into an elastic IP address (EIP).

Operation description

Usage notes

After a public IP address is converted into an EIP, the EIP is billed separately. Make sure that you fully understand the billing methods of EIPs. For more information, see Billing overview.

When you call this operation, make sure that the ECS instance meets the following requirements:

  • The instance is in the Stopped (Stopped) or Running (Running) state.
  • The instance has no EIPs associated.
  • The instance has no configuration change tasks that have not taken effect.
  • The public bandwidth of the instance is not 0 Mbit/s.
  • If the instance is a subscription instance, the billing method for network usage of the instance must be pay-by-traffic. The public IP address of a subscription instance that uses the pay-by-bandwidth billing method for network usage cannot be converted into an EIP. This requirement does not apply to pay-as-you-go instances. For more information, see Change the billing method for network usage.
  • If the instance is a subscription instance that resides in a VPC, the instance does not expire within 24 hours.


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

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters


The ID of the instance whose public IP address you want to convert into an EIP.


The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list.


Response parameters


The request ID.



Sample success responses


  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"

Error codes

HTTP status codeError codeError messageDescription
400OperationDenied.CloudboxNotSupportThis operation is denied, because the specified ECS instance which is in the Cloudbox dose not support PublicIp or Eip.-
400OperationDenied.DedicatedRegionNotSupportedThis operation is denied, because the specified ECS instance which is in the dedicated region dose not support PublicIp or Eip.error of api not supported by the exclusive cloud
403InvalidInstanceId.PlanedChange%sYour operation is invalid because a configuration change has been scheduled for the specified instance.
403InvalidEndTime.OperateNotSupport%sThe instance is in a state that does not support the current operation.
403InvalidInstanceStatus.Released%sThe operation is invalid. Check the state of the instance.
403IncorrectInstanceStatus%sThe instance is in a state that does not support the current operation.
403OperationDenied%sThe operation is denied.
403InvalidInternetChargeType.ValueNotSupported%sThe specified InternetChargeType parameter is invalid.
403InvalidInstanceId.NotFound%sThe specified instance does not exist. Check whether the InstanceId parameter is valid.
403MaxEIPQuotaExceededThe number of EIP exceeds the limit per region.The maximum number of EIPs in the current region has been reached.
403Forbidden.InvalidPublicBandwidthThe specified instance public bandwidth is less than 1M.The specified public bandwidth value of the instance is invalid.
403InvalidInstance.OverduePaymentThe special instance due to overdue payment,this operation is not supported.Your account has overdue payments. Add funds to your account and try again.
403EIPMaxBandwidthExceededThe bandwidth of instance exceeds the limitation of EIP in this region.-
403IncorrectInstanceStatusThe special instance status not support this operate!-
403InvalidAccountStatus.NotEnoughBalanceYour account does not have enough balance.Your account balance is insufficient. Add funds to your account and try again.
403Forbidden.RiskControlThis operation is forbidden by Aliyun RiskControl system.The operation is forbidden by the risk control system.

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

Change history

Change timeSummary of changesOperation
2023-10-10The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
    delete Error Codes: 403
    delete Error Codes: 404