Serverless VPC connector, Google APIs, traffic routing and best practices

Viewed 689

Working for a Findata company, we have strict requirements in terms of compliance to be considered "safe" to work with us.

I took some time reading about Serverless VPC connector specifically and it raised mainly two questions.

Here's an architecture diagram that may help answering question 2.

enter image description here

Question 1

I understand that when creating a Serverless VPC connector, you can connect to any private IP present in the same VPC. For instance, a Cloud Run app that connects to a Cloud SQL instance through it's private IP.

What I am still wondering, is how it works when using Google Cloud APIs. For instance, let's take a Cloud Run app that consumes data from BigQuery.

Knowing that we can configure egress traffic to be routed like so: VPC connector egress routing

If we route all traffic through the VPC connector, from my tests, it will reach BigQuery API only if the subnet associated to the connector activated Private Google Access

Private Google access radio button in subnet page

So here it's going through the VPC for sure. The downside (big?) is that it consumes bandwidth of your connector, right? Also, if the app is scaling up, bandwidth consumption will increase.

My question there is:

To avoid this overhead, does Route only requests to private IPs through the VPC connector option use also the private network? Or does it go to Internet to reach Google APIs?

Question 2

For us, connectors are expensive. We were thinking on how to deploy them (if required, it actually depends on the answer of the question 1)

From what I know, for expensive network setup (like sharing an Cloud Interconnect link), people tends to create a Host Project that manage all the networking and share it using Shared VPC

My question there is:

Is it something to consider as well for Serverless VPC connector? Is it better to create few big ones and share them to multiple serverless service or create a lot of small ones?

0 Answers
Related