I have a google cloud function which needs to access the MongoDB hosted on Atlas (GCP). This cloud function needs to access a specific API hosted outside GCP. For security reasons they need to allow the cloud functions IP address on their firewall rules.
To enable the static IP address request, I created a serverless VPC connector and configured all the egress traffic for my cloud function.
Once I configured, the connection for mongoDB from my cloud function is failing even if I allow all incoming traffic (just for testing).
I was thinking of VPC peering to allow cloud functions to access mongoDB, but I have not been able to configure it yet. The VPC pairing shows as "PENDING" state.
Does Serverless VPC guarantee static IP address?
Why am I not able to connect to mongoDB via serverless VPC connector even though all incoming traffic is allowed?
Can we configure VPC peering between serverless VPC and mongodb atlas?