All Products
Search
Document Center

Elastic IP Address:UnassociateEipAddress

Last Updated:Jun 19, 2026

Disassociates an elastic IP address (EIP) from the cloud resource to which it is bound.

Operation description

  • The UnassociateEipAddress operation is asynchronous. After you send a request, the system returns a request ID, but the EIP is not yet disassociated. The disassociation task continues to run in the background. You can call DescribeEipAddresses to query the status of the EIP:
    • If the EIP is in the Unassociating state, the EIP is being disassociated. In this state, you can only perform query operations.

    • If the EIP is in the Available state, the EIP is disassociated.

  • The UnassociateEipAddress operation does not support concurrent disassociation requests for the same EIP.

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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

vpc:UnassociateEipAddress

delete

Instance

acs:ecs:{#regionId}:{#accountId}:instance/{#InstanceId}

*Address

acs:vpc:{#regionId}:{#accountId}:eip/{#AllocationId}

HaVip

acs:vpc:{#regionId}:{#accountId}:havip/{#HaVipId}

None None

Request parameters

Parameter

Type

Required

Description

Example

Force

boolean

No

Specifies whether to forcefully disassociate the EIP when the EIP is associated with a NAT gateway that has DNAT or SNAT entries configured. Valid values:

  • false (default): does not forcefully disassociate the EIP.

  • true: forcefully disassociates the EIP.

false

RegionId

string

No

The region ID of the EIP to disassociate. You can call DescribeRegions to query region IDs.

cn-hangzhou

AllocationId

string

Yes

The ID of the EIP to disassociate.

eip-2zeerraiwb7uj6i0d****

InstanceId

string

No

The instance ID of the cloud resource from which to disassociate the EIP. You can enter the instance ID of a NAT gateway, Classic Load Balancer (CLB) instance, ECS instance, secondary elastic network interface controller (NIC), high availability virtual IP address instance, or an IP address.

i-hp3akk9irtd69jad****

InstanceType

string

No

The type of the cloud resource from which to disassociate the EIP. Valid values:

  • EcsInstance (default): an ECS instance in a virtual private cloud (VPC).

  • SlbInstance: a load balancing instance in a virtual private cloud (VPC).

  • NetworkInterface: a secondary elastic network interface controller (NIC) in a virtual private cloud (VPC).

  • Nat: a NAT gateway.

  • HaVip: a high availability virtual IP address.

  • IpAddress: an IP address.

EcsInstance

PrivateIpAddress

string

No

The private IP address of the ECS instance or secondary elastic network interface controller (NIC) instance from which to disassociate the EIP.

192.XX.XX.2

ClientToken

string

No

The client token that is used to ensure the idempotence of the request.

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

Note

If you do not specify this parameter, the system automatically uses the RequestId as the ClientToken. The RequestId may be different for each API request.

02fb3da4-130e-11****

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

0ED8D006-F706-4D23-88ED-E11ED28DCAC0

Examples

Success response

JSON format

{
  "RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}

Error codes

HTTP status code

Error code

Error message

Description

400 IncorrectEipStatus Current elastic IP status does not support this operation.
400 InvalidInstanceId.NotFound Specified instance does not exist.
400 IncorrectInstanceStatus The current status of instance does not support this operation.
400 InvalidInstanceType.ValueNotSupported The specified value of InstanceType is not supported.
400 IncorrectHaVipStatus This operation is denied because satus of the specified HaVip is neither Available nor InUse. You cannot perform the operation when the specified HAVIP is in the Available or InUse state.
400 OperationDenied Eip of default vpc not allow this operation
400 InvalidParameter The specified parameter is not valid.
400 TaskConflict The eip operate too frequent, TaskConflict. Operations are too frequent and tasks conflict with each other.
400 InvalidBindingStatus The eip binding status invalid.
400 Forbidden.FinancialLocked The ip business status is invalid. The error message returned because the instance has overdue payments.
400 InvalidIpStatus.HasBeenUsedBySnatTable The removed ip address has been used by snat table.
400 InvalidIpStatus.HasBeenUsedByForwardEntry The specified address has been used by forwardTable.
400 Eni.Attached The eni should be detached from ecs when associating with direct eip. If the ENI is associated with an EIP in cut-through mode, you must disassociate the ENI from the ECS instance.
400 InvalidEIPStatus.BizDisabled The EIP has been locked. The error message returned because the EIP is locked.
400 InvalidStatus.EcsStatusNotSupport The special instance status Pending is not support operate The operation is not supported because the instance is suspended.
400 InvalidStatus.EniStatusNotSupport %s
400 InvalidStatus.SnatOrDnat Operation failed because snat or dnat in unstable status. The EIP failed to be disassociated because the SNAT or DNAT entry is in an unstable state.
400 DependencyViolation.SnatEntry The specified eip is in ip pool.
400 %s %s
400 InvalidStatus.NotAllow Bind instance status invalid The status of the associated instance is invalid.
400 Forbidden The eip instance owener error The EIP does not belong to your account. Check whether you have the permissions to perform the operation on the EIP.
400 InvalidLoadBalancerId.NotFound LoadBalancerId does not exist. The ID of the SLB instance does not exist.
400 OperationFailed.SystemBusy Operation failed because system is busy. The error message returned because the system is busy. Try again later.
404 InvalidAllocationId.NotFound Specified allocation ID is not found The specified EIP does not exist. Check whether the specified value is valid.
404 InvalidBindInstance.NotFound The specified bind instance does not exist.
404 Forbidden.RegionNotFound Specified region is not found during access authentication.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.