AnalyticDB for PostgreSQL supports two types of endpoints: internal and public. By default, an internal endpoint is provided for you to connect to an AnalyticDB for PostgreSQL instance. If you want to connect to an AnalyticDB for PostgreSQL instance from your application that is deployed on an Elastic Compute Service (ECS) instance across regions or network types, you must apply for a public endpoint.

Scenarios

Scenario Description
Only an internal endpoint is required Your application is deployed on an ECS instance that is located within the same region and has the same network type as your AnalyticDB for PostgreSQL instance.
Only a public endpoint is required
  • Your application is deployed on an ECS instance that is located within a region different from your AnalyticDB for PostgreSQL instance.
  • Your application is deployed on a third-party system.
Both an internal endpoint and a public endpoint are required
  • Specific modules of your application are deployed on an ECS instance that is located within the same region and have the same network type as your AnalyticDB for PostgreSQL instance, but other modules are deployed on an ECS instance that is located in a different region.
  • Specific modules of your application are deployed on an ECS instance that is located within the same region and have the same network type as your AnalyticDB for PostgreSQL instance, but other modules are deployed on a third-party system.

Precautions

  • Before you connect your application to your AnalyticDB for PostgreSQL instance, you must add the IP address or the corresponding CIDR block of the application to a whitelist of the instance. For more information, see Configure an IP address whitelist.
  • If you use a public endpoint to connect to your instance, security is compromised. Proceed with caution. To improve security and accelerate data transfer, we recommend that you migrate your application to an ECS instance that is located within the same region as your AnalyticDB for PostgreSQL instance.

Procedure

  1. Log on to the AnalyticDB for PostgreSQL console.
  2. In the upper-left corner of the console, select the region where the instance resides.
  3. Find the instance that you want to manage and click its ID.
  4. In the left-side navigation pane, click Database Connection.
  5. Click Apply for Public Endpoint or Release Public Endpoint to the right of Public Endpoint.

Related operations

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.