Hello everyone,
I am trying to perform a query to a serverless MongoDB cluster from a lambda function in a private subnet, through a peered connection following the steps suggested in the provided Set Up a Network Peering Connection — MongoDB Atlas. However, it always returns the message ‘connection 1 to *IP:27017 closed’ .
Here is the configuration I have:
-
MongoDB Peering Connection active.
-
AWS Peering Connection active.
In the route table of VPC-xxx, the CIDR of the MongoDB VPC has been added. In the route table of the private subnet xxx, the CIDR of the MongoDB VPC has been added.
- AWS Lambda associated with VPC-xxxx and private subnet xxxx, and rout tables.
When I add access from all sources to the IP Access list, it connects successfully. I have followed the steps for the connection, but I am unable to achieve successful communication. Any ideas on what configuration steps might be missing?