You can call this operation to add one or more RDS instances to a scaling group.

Description

Before you call this operation, make sure that the following requirements are met:

  • The RDS instance and the scaling group must belong to the same account.
  • The RDS instance must be unlocked. For more information about the lock policy, see RDS usage instructions.
  • The RDS instance must be in the Running state.
  • After an RDS instance is added, the default whitelist of the instance can contain a maximum of 1,000 IP addresses. For more information about the whitelist, see Configure a whitelist.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
DBInstance.N RepeatList Yes rm-bp12cy3****

The IDs of RDS instances. You can add up to five RDS instances to a scaling group at a time.

ScalingGroupId String Yes AG6CQdPU8OKdwLjgZcJ****

The ID of the scaling group.

Action String No AttachDBInstances

The operation that you want to perform. Set the value to AttachDBInstances.

ForceAttach Boolean No false

Specifies whether to add the private IP addresses of all instances in the current scaling group to the whitelist of the RDS instance. Valid values:

  • true: adds the private IP addresses to the whitelist.
  • false: does not add the private IP addresses to the whitelist.

Default value: false

Response parameters

Parameter Type Example Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

Examples

Sample requests


http://ess.aliyuncs.com/?Action=AttachDBInstances
&ScalingGroupId=AG6CQdPU8OKdwLjgZcJ****
&DBInstance.1=rm-bp12cy3****
&<Common request parameters>

Sample success responses

XML format

<AttachDBInstancesResponse>
      <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
</AttachDBInstancesResponse>

JSON format

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

Error codes

For more information about error codes, visit API Error Center.

HTTP status code

Error code

Error message

Description

404

InvalidScalingGroupId.NotFound

The specified scaling group does not exist.

The error message returned because the specified scaling group does not exist in the current account.

400

QuotaExceeded.RDS

"RDS" quota exceeded.

The error message returned because the maximum number of RDS instances in the scaling group has been reached.

400

InvalidDBInstanceId.NotFound

The specified value of parameter "%s" is not valid.

The error message returned because the specified RDS instance does not exist.

400

IncorrectDBInstanceStatus

The current status of DB instance "%s" does not support this action.

The error message returned because the RDS instance is in a state that does not support the current operation.

400

QuotaExceeded.DBInstanceSecurityIP

Security IP quota exceeded in DB instance "%s".

The error message returned because the maximum number of IP addresses in the whitelist of the RDS instance has been reached.

400

InvalidInstanceIds.PrivateIpNotFound

Can not find all private ips of instances in specific scaling group.

The error message returned because the private IP addresses of an RDS instance in the scaling group cannot be obtained.