AnalyticDB for PostgreSQL supports two types of endpoints: internal and public. An internal endpoint is provided by default. Apply for a public endpoint when your application needs to connect from outside the instance's region or network type.
When to use a public endpoint
| Endpoint type | Use when |
|---|---|
| Internal only | Your application runs on an Elastic Compute Service (ECS) instance in the same region and network type as the AnalyticDB for PostgreSQL instance. |
| Public only | Your application runs on an ECS instance in a different region, or on a third-party system. |
| Both | Some modules of your application run on a same-region, same-network-type ECS instance, while other modules run in a different region or on a third-party system. |
Prerequisites
Before you begin, ensure that you have:
An AnalyticDB for PostgreSQL instance
The IP address or CIDR block of your application (required to configure the whitelist before connecting)
Apply for or release a public endpoint
Public endpoints expose your instance to the internet and reduce security. For production workloads, migrate your application to an ECS instance in the same region as your AnalyticDB for PostgreSQL instance to improve security and data transfer speed.
Log on to the AnalyticDB for PostgreSQL console.
In the upper-left corner, select the region where the instance resides.
Find the instance and click its ID.
In the left-side navigation pane, click Database Connection.
To the right of Public Endpoint, click Apply for Public Endpoint or Release Public Endpoint.
Before you connect your application, add the IP address or CIDR block of your application to the instance whitelist. For details, see Configure an IP address whitelist.
API reference
| Operation | Description |
|---|---|
| AllocateInstancePublicConnection | Applies for a public endpoint for an AnalyticDB for PostgreSQL instance. |
| ReleaseInstancePublicConnection | Releases the public endpoint of an AnalyticDB for PostgreSQL instance. |