ApsaraDB RDS for MariaDB provides two endpoint types: an internal endpoint (created by default) and a public endpoint. To connect to an RDS instance from outside the Alibaba Cloud internal network, apply for a public endpoint.
When to use a public endpoint
The internal endpoint is sufficient when your Elastic Compute Service (ECS) instance and RDS instance share the same region and network type. Traffic stays on the internal network — no public endpoint needed.
Apply for a public endpoint in these scenarios:
-
Your ECS instance is in a different region or uses a different network type than the RDS instance. For more information, see Network types.
-
You are connecting from a device outside Alibaba Cloud.
Endpoint comparison
| Internal endpoint | Public endpoint | |
|---|---|---|
| Provisioned automatically | Yes | No — must be applied for manually |
| Can be released | No | Yes |
| Network type can be changed | Yes | — |
| Network | Internal network (private) | Internet |
| Recommended for | ECS instances in the same region and network type | Cross-region, cross-network-type, or external clients |
If you use a public endpoint to connect to an RDS instance, data security is compromised. Proceed with caution. To reduce exposure, migrate your application to an ECS instance in the same region and network type as the RDS instance, and connect using the internal endpoint instead.
Apply for or release a public endpoint
Applying for a public endpoint is free. Traffic generated through the public endpoint is also free.
-
Go to the Instances page. In the top navigation bar, select the region where the RDS instance resides, then find the RDS instance and click the instance ID.
-
In the left-side navigation pane, click Database Connection.
-
Do one of the following:
-
To apply: click Apply for Public Endpoint.
-
To release: click Disable Public Endpoint.
-
-
In the confirmation dialog, click OK.
API reference
| Operation | API | Description |
|---|---|---|
| Apply for a public endpoint | AllocateInstancePublicConnection | Applies for a public endpoint for an instance |
| Release a public endpoint | ReleaseInstancePublicConnection | Releases the public endpoint of an instance |