Unable to Establish Private Endpoint for Dedicated Cluster (Works for Serverless Cluster)

Hi

I successfully set up a Private Endpoint for a Serverless Instance in MongoDB Atlas and was able to connect without any issues. The response time was significantly improved. However, since Serverless Clusters might be deprecated in the future, I decided to purchase a Dedicated Cluster and attempted to establish a Private Endpoint for it using the same setup steps. Unfortunately, I have been unable to connect to the Private Endpoint successfully.

Troubleshooting Steps I Have Taken

To eliminate possible issues, I have already tried the following:

  • Recreated the AWS VPC from scratch
  • Recreated the AWS Private Endpoint multiple times
  • Verified Security Groups settings to ensure inbound/outbound rules allow traffic on port 27017**
  • Recreated the MongoDB Atlas Private Endpoint multiple times
  • Manually linked the AWS Private Endpoint with MongoDB Atlas using AWS CLI
  • Ensured both my Private Endpoint and the MongoDB Private Endpoint are in Available state
  • Confirmed that the Private Endpoint is correctly associated with the same Subnet as my AWS Lambda function
  • Tested different Private IPs assigned to the MongoDB Private Endpoint

Problem Details

  • Despite these extensive troubleshooting steps, I still cannot establish a connection.
  • When using AWS Lambda (inside VPC) with Node.js to connect to MongoDB, the connection times out without any error messages.
  • However, when I remove Lambda from the VPC, it successfully connects to MongoDB over the public internet.
  • This suggests that the issue is specific to Private Endpoint connectivity in the Dedicated Cluster.

Additional Observations

  • The MongoDB Private Endpoint is in Available state.
  • The AWS Private Endpoint is also in Available state.
  • AWS VPC Reachability Analyzer confirms there is no explicit block between Lambda and MongoDB’s Private IP.
  • Using nc -zv to test the connection from within Lambda to MongoDB Private IP fails with timeout.

Question for the Community

Has anyone successfully connected a Dedicated Cluster using a Private Endpoint through AWS Lambda?
Are there any additional configurations required for Dedicated Clusters that are different from Serverless Clusters?
Any guidance on how to further debug this issue would be greatly appreciated.

Thanks in advance for any help!

Hi there

The steps taken for setting up Private Endpoint on a Dedicated cluster are slightly different from those on a Serverless cluster. You can find the steps outlined here.