Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Cloud Run Service http requests to a Compute Engine VM behind a firewall

Hi!

I'm fairly new to GCP so excuse me if this is a trivial question. Tried searching across the forum but wasn't able to solve my problem just yet.

I have a Cloud Run service (eu-west1) which needs to make HTTP requests to a VM (eu-west3) in the same project. This compute  engine is behind a Firewall which only whitelists certain IPs. At this moment the requests made from my Cloud Run service to the VM seem to time out, possibly because of the firewall rule.

Did some research and I believe the solution should be to create a Serverless VPC (https://cloud.google.com/run/docs/configuring/connecting-shared-vpc) and attach it to the Cloud Run service. I believe you should then be able to whitelist this IP address on the Firewall? Is this the approach to take?

At least that's what I tried but calls are still timing out. Any tips/suggestions here? Is the fact that the Cloud Run service and the Compute Engine are in different regions a problem? I created the VPC in the region of the Cloud Run service. Would it work if I recreated the VM in eu-west1 or is there something I'm missing?

2 0 257