All Products
Search
Document Center

:Apply for a public endpoint

Last Updated:Jun 20, 2026

You can apply for a public endpoint for your ApsaraDB for MongoDB instance for connections over the public internet.

Background information

ApsaraDB for MongoDB sharded cluster instances support three network types: VPC, classic network, and the public internet. The following table describes the endpoints for each network type.

Endpoint type

Description

VPC endpoint

  • A virtual private cloud (VPC) is an isolated network that provides higher security and performance than the classic network.

  • By default, ApsaraDB for MongoDB provides VPC endpoints for instances to ensure high security and high performance.

Classic network endpoint

Cloud services on the classic network are not isolated. Unauthorized access can be blocked only by using security groups or whitelists. For more information about how to switch the network type of an ApsaraDB for MongoDB instance from classic network to VPC, see Switch the network type of an ApsaraDB for MongoDB instance from classic network to VPC.

Note

The classic network is not supported for DynamoDB-compatible sharded cluster instances.

Public endpoint

  • Risks arise when you connect to your ApsaraDB for MongoDB instance over the Internet. In this connection, ApsaraDB for MongoDB does not provide public endpoints by default.

  • If you want to connect to an ApsaraDB for MongoDB instance from a device outside Alibaba Cloud (such as an on-premise device), you must apply for a public endpoint.

Procedure

  1. Log on to the ApsaraDB for MongoDB console.

  2. In the upper-left corner of the page, select the resource group and region to which the instance belongs.

  3. In the left-side navigation pane, click Sharded Cluster Instance.

  4. On the page that appears, find the instance that you want to manage and click its ID.

  5. In the left-side navigation pane, click Database Connections.
  6. In the Public Connections section, click Apply for Public Connection String.
  7. In the dialog box that appears, select the Node Type and Node ID for the node that needs a public endpoint, and then click OK.
    Parameter Value Description
    Node Type Shard A shard node. Before you apply for a public endpoint for a shard node, you must first apply for a shard endpoint.

    You may need to read oplog data from a shard node over the public internet for specific tasks, such as data synchronization between clusters. To do so, you can apply for a public endpoint for the node.

    cs A config server. Before you apply for a public endpoint for a config server, you must first apply for a shard endpoint.

    You may need to read configuration information from the config server over the public internet for specific tasks, such as data synchronization between clusters. To do so, you can apply for a public endpoint for the node.

    Mongos A mongos. This is the default option. In most cases, applications only need to connect to a mongos to read and write data.
    Node ID Select the ID of the node for which you want to apply for a public endpoint. None
    Note
    • For more information about node types, see Sharded cluster architecture.
    • You can repeat this step to apply for public endpoints for multiple nodes. However, you must wait for the current public endpoint to be created before applying for a new one.

Results

After the application is complete, a public endpoint and a corresponding ConnectionStringURI are generated for the node. For details, see Overview of sharded cluster instance connections.

More information

Next steps

Before you can connect to the instance using the new public endpoint, you must add the public IP address of your client to the instance's whitelist. For more information, see Configure a whitelist.