Can't establish peering connection to Google App Engine

Hey!

I’ve set up the peering connection between MongoDB Atlas and Googles “default” VPC and the connection is labeled as “active” on both ends.

The ip range of the vpc is whitelisted in MongoDB Atlas.

But my node hosted in google-app-engine still gets timed out when accessing the MongoDB.

I use the connection url of mongodb atlas for peered connection in the form of (notice the “-pri”):

mongodb+srv://<username>:<password>@<my-cluster>-pri.rthhs.mongodb.net/<dbname>?retryWrites=true&w=majority

Which part am i missing to establich the connection? I’ve even set up a google vpc connector but the problem persists.

As soon as i delete my “allow all ip adresses” whitelist and only have the one for my peering CIDR the backend can’t connect to mongo atlas anymore.

Thanks for any help!

2 Likes

The following helped me : explored “VPC network peering” -> , clicked on “Exported routes” and chose a “destination ip addresses” for the region, where both my appengine and mongodb atlas reside.
If this does not hep you - try to review “View Database Access History” in your MongoDB Atlas project and cluster. It should give you an idea what IP addresses accesses MongoDB, while whitelist for 0.0.0.0/0 is enacted.