You can call the CreateDBProxyEndpointAddress operation to create a proxy endpoint that is used to connect to the database proxy of an ApsaraDB RDS instance.

After you enable the dedicated proxy feature for an ApsaraDB RDS for MySQL instance or enable the database proxy feature for an ApsaraDB RDS for PostgreSQL instance, a default proxy endpoint is created. You can call this operation to create proxy endpoints of different network types. For more information, see What are database proxies? and Activate and configure the database proxy feature for an ApsaraDB RDS for PostgreSQL instance.

Note
  • The following network types are supported for instances that use local SSDs: VPC, Classic, and Public.
  • The following network types are supported for instances that use standard SSDs or enhanced SSDs (ESSDs): VPC and Public. If you want to create a proxy endpoint of the public network type, you must configure IP address whitelists for the instance and its read-only instances to ensure connectivity between the client and the instance. You can call the ModifySecurityIps operation to configure an IP address whitelist for an instance.

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 for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateDBProxyEndpointAddress

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

RegionId String Yes cn-hangzhou

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

DBInstanceId String Yes rm-t4n3axxxxx

The ID of the instance. You can call the DescribeDBInstances operation to query the ID of the instance.

DBProxyEndpointId String Yes ta9um4xxxxx

The ID of the proxy endpoint. You can call the DescribeDBProxyEndpoint operation to query the ID of the proxy endpoint.

ConnectionStringPrefix String Yes test1234

The prefix of the proxy endpoint. Enter a custom prefix.

DBProxyNewConnectStringPort String No 3306

The port number that is associated with the proxy endpoint.

  • If the instance runs MySQL, the default value is 3306.
  • If the instance runs PostgreSQL, the default value is 5432.
DBProxyConnectStringNetType String Yes Public

The network type of the proxy endpoint. Valid values:

  • Public
  • VPC
  • Classic

Default value: Classic.

VPCId String No vpc-bpxxxxxx

The ID of the virtual private cloud (VPC) to which the proxy endpoint belongs. You can call the DescribeDBInstanceAttribute operation to query the ID of the VPC.

Note If you set the DBProxyConnectStringNetType parameter to VPC, you must also specify the VPCId parameter.
VSwitchId String No vsw-bpxxxxxx

The ID of the vSwitch associated with the specified VPC. You can call the DescribeDBInstanceAttribute operation to query the ID of the vSwitch.

Note If you set the DBProxyConnectStringNetType parameter to VPC, you must also specify the VSwitchId parameter.
DBProxyEngineType String No normal

An internal parameter. You do not need to specify this parameter.

ResourceGroupId String No rg-acfmy*****

The ID of the resource group.

Response parameters

Parameter Type Example Description
RequestId String F2911788-25E8-42E5-A3A3-1B38D263F01E

The ID of the request.

Examples

Sample requests

http(s)://rds.aliyuncs.com/?Action=CreateDBProxyEndpointAddress
&RegionId=cn-hangzhou
&DBInstanceId=m-t4n3axxxxx
&DBProxyEndpointId=ta9um4xxxxx
&DBProxyConnectStringNetType=Public
&ConnectionStringPrefix=test1234
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateDBProxyEndpointAddressResponse>
<RequestId>F2911788-25E8-42E5-A3A3-1B38D263F01E</RequestId>
</CreateDBProxyEndpointAddressResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "F2911788-25E8-42E5-A3A3-1B38D263F01E"
}

Error codes

HTTP status code Error code Error message Description
400 InvalidPort.Malformed Specified port is not valid. The error message returned because the port number that you specified is invalid.
400 NetTypeExists Specified net type already existed. The error message returned because a proxy endpoint of the specified network type already exists.
400 IncorrectDBInstanceNetType Current DB instance net type does not support this operation. The error message returned because the network type of the instance does not support this operation.
400 InvalidConnectionString.Duplicate Specified connection string already exists in the Aliyun RDS. The error message returned because the proxy endpoint that you specified already exists. Specify a different endpoint.
400 InvalidVpcInstanceId Specified vpc instance id is not valid. The error message returned because the VPC ID that you specified is invalid.
400 InvalidDBInstanceName Specified parameter DBInstanceName is not valid. The error message returned because the value of the DBInstanceName parameter is invalid. Check whether the value is null or an empty string.
403 IncorrectDBInstanceType Current DB instance type does not support this operation. The error message returned because this operation is not supported when the instance is in the current state.
403 IncorrectDBInstanceState Current DB instance state does not support this operation. The error message returned because this operation is not supported when the instance is in the current state.
404 Endpoint.NotFound Specified endpoint is not found. The error message returned because the port used to connect to the dedicated proxy endpoint is not found.
404 InvalidVSwitchId.NotFound The specified VSwitch is invalid. The error message returned because the vSwitch ID that you specified is invalid.
404 Maxscale.NotFound The related maxscale instance is not found. The error message returned because the associated MaxScale instances cannot be found.

For a list of error codes, visit the API Error Center.