For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.

Learn About Private Endpoints in Atlas

Cloud Provider

Note

This page applies to both Atlas Infinite and Atlas Core.

MongoDB Atlas supports private endpoints on dedicated clusters. Select your cluster type to learn which cloud providers Atlas supports:

Note

This feature is available for M10 clusters or higher. To learn more about which features are available for Free clusters, see Atlas Free Cluster Limits, and for Flex clusters, see Atlas Flex Limitations.

You can also set up private endpoints for your Online Archive. To learn more, see Set Up a Private Endpoint for Online Archives.

Note

To set up a private endpoint, you must have Organization Owner, Project Owner, or Project Network Access Manager access to the project.

Important

Private endpoint connection strings are available as a Preview. The feature and corresponding documentation might change at any time in the Preview stage. To learn more, see Preview Features.

Private endpoint connection strings are a configurable Atlas resource. After you opt your project in, you can create, view, edit, and delete named connection strings that route traffic through only the private endpoints that you select. Manage connection strings from the Connection Strings tab of the Private Endpoint page for your dedicated cluster in the Atlas UI. To learn how, see Manage Private Endpoint Connection Strings.

Configurable connection strings provide the following benefits:

  • Use multiple private endpoints across multiple regions without converting your cluster to a sharded cluster or enabling regionalized private endpoints.

  • Choose which private endpoints a connection string routes through, to isolate environments or restrict applications to specific authorized endpoints.

  • Rely on validation that blocks changes that would break connectivity, such as cluster modifications that leave a connection string without endpoint coverage in a region.

When you opt in, Atlas imports your existing private endpoint-aware connection strings as imported connection strings so that they remain available without changes. Imported connection strings are read-only: you can view and delete them, but you can't edit them.

Connection strings that you create after opting in are self-managed. You can edit and delete self-managed connection strings. By default, each cluster supports up to three self-managed connection strings.

A connection string has one of the following statuses:

Atlas Administration API State
Atlas UI Status
Description

PENDING

Pending

Atlas is validating and provisioning the connection string.

AVAILABLE

Available

Connection string is ready to use.

FAILED

Error

Validation or provisioning failed. View the error details to learn the cause.

When you create or edit a connection string, Atlas validates your endpoint selection against the following rules:

  • Select at most one endpoint per region.

  • Select at least one endpoint that is attached to the cluster.

  • For a replica set, select at least one endpoint in each region where the cluster is deployed.

  • For a sharded cluster, select endpoints in a single region or at least one endpoint in each region where the cluster is deployed.

  • You can select an available endpoint in a region where the cluster doesn't yet have nodes. Atlas routes traffic through that endpoint as soon as it deploys nodes in that region.

If your selection violates a rule, the error identifies the failed rule and how to resolve it. For example, the Atlas UI displays the following error: Invalid selection. Select either endpoints for a specific region or at least one endpoint per region your cluster is deployed in.

If your cluster is eligible, you can also create optimized connection strings as self-managed connection strings. To learn more, see How can I optimize connection performance for sharded clusters using private endpoints?.

Atlas can generate an optimized SRV connection string for sharded clusters using the load balancers from your private endpoint service. When you use an optimized connection string, Atlas limits the number of connections per mongos between your application and your sharded cluster. The limited connections per mongos improve performance during spikes in connection counts.

Atlas doesn't support optimized connection strings for clusters that run on Google Cloud or Azure. To learn more about optimized connection strings for sharded clusters behind a private endpoint, see How can I optimize connection performance for sharded clusters using private endpoints?.

When you enable private endpoints, you can still enable access to your Atlas clusters using other methods, such as adding public IPs to IP access lists and network peering.

Clients connecting to Atlas clusters using other methods use standard connection strings. Your clients might have to identify when to use private endpoint-aware connection strings and standard connection strings.

When you use a private endpoint to connect to a multi-cloud deployment, you can access only the nodes hosted in the cloud service provider and region that you're connecting from. To access all nodes in your multi-cloud deployment, use alternative connection methods described in the Connections to Multi-Cloud Deployments section in the "Configure High Availability and Workload Isolation" topic.

Important

Deprecation

The regionalized private endpoint setting is deprecated and will be removed after August 1, 2028. Until then, projects that use the setting continue to work without changes.

For new deployments, use private endpoint connection strings instead. If your project opts in to connection strings, you can't change the regionalized private endpoint setting, and you select regions for each connection string instead.

For global sharded clusters that you deploy in multiple regions, if you need to connect to Atlas using a private endpoint from networks that can't be peered with one another, you can deploy multiple private endpoints to a region.

You can deploy any number of private endpoints to regions that you deployed your cluster to. Each regional private endpoint connects to the mongos instances in that region.

WARNING: Your connection strings to existing multi-region and global sharded clusters change when you enable this setting.

You must update your applications to use the new connection strings. This might cause downtime.

You can enable this setting if your Atlas project contains only sharded clusters.

You can't disable this setting if you have:

  • More than one private endpoint in more than one region, or

  • More than one private endpoint in one region and one private endpoint in one or more regions.

You can only create sharded clusters when you enable the regionalized private endpoint setting. You can't create replica sets.

To use this feature, you must enable the regionalized private endpoint setting.

To enable or disable the regionalized private endpoint setting:

To enable the regionalized private endpoint setting for your project using the Atlas CLI, run the following command:

atlas privateEndpoints regionalModes enable [options]

To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas privateEndpoints regionalModes enable.

To disable the regionalized private endpoint setting for your project using the Atlas CLI, run the following command:

atlas privateEndpoints regionalModes disable [options]

To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas privateEndpoints regionalModes disable.

To return the regionalized private endpoint settings for your project using the Atlas CLI, run the following command:

atlas privateEndpoints regionalModes describe [options]

To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas privateEndpoints regionalModes describe.

Warning

Migrating from Multiple Endpoint Services to Single Endpoint Service

To migrate from multiple endpoint services to a single endpoint service that supports multiple endpoints, you must terminate the endpoints and endpoint services in the other regions first. This migration requires downtime.

The migration process includes:

  1. Terminating endpoints in other regions

  2. Terminating endpoint services in other regions

  3. Provisioning new endpoints in your VPCs or VNets to connect to the remaining endpoint service

  4. Updating application connection strings (which might require an application restart)

Downtime occurs between terminating the other endpoints and updating your application to use the correct connection string.

For multi-region clusters, you must create a private endpoint for each region with a node.

If you're performing maintenance on a multi-region cluster, do not alter or remove private endpoints until maintenance is complete to avoid cluster downtime.

If you're moving from a multi-region to a single-region cluster, you can remove old private endpoints only after verifying that your cluster is fully functional in the new single-region setup and you've directed all traffic through the new single-region private endpoint.

  • Free clusters (formerly known as M0) and Flex clusters do not support connecting through a private endpoint.
  • Before you can deploy a private endpoint to a region, you must first resume any paused clusters in your project.

To enable connections to Atlas using private endpoints, you must:

  • Have a valid payment method already configured for your organization.