I’m working with Cloud run service and I have following situation:
Cloud Run Services A has configured a Serverless VPC Access Connector routing all traffic through it.
Cloud Run Service A should call an external API, for example Facebook or some Broker for payments.
Due to I have configured to route all traffic through VPC Connector, also requests for these external Service are routed through connector?
I’m asking because the charges increase if I have more egress traffic through connector and in this cases I would not want that traffic passing through it.
Hi, with option b, once your request is in the VPC network, it will be
routed according to how the network is set up, respecting firewall rules,
routes, Cloud NAT configuration, etc. You can use Cloud NAT to get a static
egress IP for your service, for example.
Hi @knet I had this exact same requirement a week ago. I followed the setup mentioned on this page (by the way documentation seems out of date since there is an option to configure this via GCP console also in addition to gcloud and TF) and I found that whitelisting my CR service (with the static egress IP) didn’t work. I tried doing the same from the console and i selected primary IP and subnet IP radio button by luck and it started working. Upon comparing what the gcloud from documentation did and the GCP console i found that gcloud Cloud NAT used the wrong option (only primary IP selection associated with the subnet) and hence failed. It would be nice to mention the data path that egress traffic takes. I am assuming it is GCE VM (from serverless vpc connector) → uses secondary subnet?? → Cloud Router → Cloud NAT → Egress IP.