I would like to know if its ok the approach I’m trying to communicate both services, if it’s ok, also I would like to know how route traffic from VPC to Cloud run.
Hi, that process is necessary if you want to reach the services using private IP addresses. If you’re OK using public IPs for service-to-service communication, instead of setting up Private Service Connect, you can enable Private Google Access (which is easier to do).
Once the traffic is on the VPC network, make sure the VPC network is configured appropriately to further route that request to Cloud Run. See Receive requests from VPC networks.
The most direct path is to enable Private Google Access on the subnets hosting your VPC resources. Once enabled, resources on the subnets can access your Cloud Run services at the default run.app URL. Traffic from your VPC to Cloud Run stays in Google’s network. In that case, the IP range for requests sent to the Cloud Run service is 0.0.0.0/32. This means that in request log entries, the remoteIp attribute of the HttpRequest will be 0.0.0.0.
But actually I don’t have a subnet in the VPC, I have only the serverless vpc connector.
You probably need to enable it on the subnet of the VPC connector (I
haven’t tested this myself but it makes logical sense).
The VPC connector subnet is hidden if you created the connector using an IP
range. But if you create a subnet yourself and then pass that subnet in
when creating the VPC Connector, you can then enable Private Google Access
on that subnet.
The solution you proposed work perfect! I created Serverless VPC Access Conector through gcloud cli and connector was assigend to subnet with Private Google access enable.