Search code examples
google-cloud-platformgoogle-compute-enginegoogle-cloud-rungoogle-vpc

Can not connect between Cloud Run and Compute engine using Internal IP


I have a service which runs on Cloud Run, and a MYSQL, MongoDB databases on Compute Engine. Currently, I'm using public IP for connect between them, I want to use internal IP for improving performance, but i cant find solution for this problem, Please help me some ideas, Thanks.


Solution

  • Now is supported. You can use VPC network connector (Beta):

    This feature is in a pre-release state and might change or have limited support. For more information, see the product launch stages.

    This page shows how to use Serverless VPC Access to connect a Cloud Run (fully managed) service directly to your VPC network, allowing access to Compute Engine VM instances, Memorystore instances, and any other resources with an internal IP address.

    To use Serverless VPC Access in a Cloud Run (fully managed) service, you first need to create a Serverless VPC Access connector to handle communication to your VPC network. After you create the connector, you set your Cloud Run (fully managed) service configuration to use that connector.

    Here how to create: Creating a Serverless VPC Access connector and here an overview about it: Serverless VPC Access example