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.
I’m struggling with this as well. And I’ve managed to lock app engine out entirely, regardless of whether or not I’ve whitelisted 0.0.0.0/0. Similar to yourself, both sides according to their respective IDEs are active. I don’t suppose you figured out what the issue was since then?
For anyone who stumbles across this post trying to find the answer, here it is:
For the App Engine Standard environment, follow this guide: cloud.google .com/community/tutorials/serverless-vpc-access-private-mongodb-atlas
Then, in your app.yaml, specify the vpc access connector you created (the region of the connector must match the region of your App Engine, either us-central1 or europe-west1)
For the App Engine Flexible environment:
You still need the vpc network peering, but you don’t need serverless vpc access.
Follow this guide: cloud.google .com/community/tutorials/serverless-vpc-access-private-mongodb-atlas
ONLY the “Configure MongoDB Atlas VPC peering”, " Configure VPC Network Peering on Google Cloud", and “Retrieve the connection string for your cluster” sections.
Then, on the Network Access page of MongoDB, add the ip range “10.0.0.0/8” - this is the entire private ip range and includes connections from App Engine
You don’t need to change anything in app.yaml as long as you are using the default google cloud vpc network.
Then, in your app.yaml, specify the vpc access connector you created (the region of the connector must match the region of your App Engine, either us-central1 or europe-west1)
Then, on the Network Access page of MongoDB, add the ip range “10.0.0.0/8” - this is the entire private ip range and includes connections from App Engine.
Something that’s not clear in the guide is what projects are being referred to in the ’ Configure MongoDB Atlas VPC peering’ and the ’ Configure VPC Network Peering on Google Cloud’ sections.
In the Configure VPC Network Peering on Google Cloud section it says:
Under Peered VPC Network , click in another project .
Enter the project ID and VPC network name that were provided at the end of the previous section, in which you configured MongoDB Atlas VPC peering.
But I used the same project at the end of the previous step. If I’m not supposed to use the same project, what project am I supposed to use and where in the guide was this created?
When you enable VPC peering in the mongoDB Atlas console, you are provided with a GCP project ID and VPC name that are generated by mongoDB. You can find them under the Peering tab of the Network Access section of the mongoDB Atlas console. Please let me know if this helps!