Updated on 2025-12-09 GMT+08:00

Binding and Unbinding an EIP

Function

This API is used to bind an EIP to a DB instance for public access or unbind an EIP from the DB instance as required.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
  • If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

rds:instance:modifyPublicAccess

write

-

-

-

-

Constraints

An EIP cannot be bound to or unbound from a DB instance that is being created, modified, restored, frozen, or rebooted.

URI

  • URI format

    PUT /v3/{project_id}/instances/{instance_id}/public-ip

  • Parameter description
    Table 1 Parameter description

    Name

    Mandatory

    Description

    project_id

    Yes

    Project ID of a tenant in a region.

    To obtain the value, see Obtaining a Project ID.

    instance_id

    Yes

    Specifies the DB instance ID.

Request

Table 2 Parameters

Parameter

Mandatory

Type

Description

public_ip

No

String

NOTICE:

When is_bind is true, public_ip is mandatory.

Specifies the EIP to be bound. The value must be in the standard IP address format.

public_ip_id

No

String

NOTICE:

When is_bind is true, public_ip_id is mandatory.

Specifies the EIP ID. The value must be in the standard UUID format.

is_bind

Yes

Boolean

  • true: Bind an EIP.
  • false: Unbind an EIP.

Example Request

  • Bind an EIP to a DB instance.
    PUT https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/public-ip
    
    {
        "public_ip":"10.10.10.1",
        "public_ip_id":"8403e9cd-a7fa-4288-8b15-c7ceac1etest",
        "is_bind":true
    }
  • Unbind an EIP from a DB instance.
    {
        "is_bind":false
    }

Response

Status Code

Error Code

For details, see Error Codes.