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

Access compute engine from cloud run service

Hi,

I have a Django Rest API running in Cloud Run.

For the time being, I also have a compute engine instance that has Redis, Celery beat, and Celery workers set up in it. (willing to architect a better solution for this later)

I tried accessing Redis in this compute instance for caching purposes from the serverless cloud run, but I got a connection timeout because the firewall was blocking the access.

Do I need to set up a VPC Access Connector for this (seems like a bit of an overkill for my use case)? I am not familiar with VPC set up nor with access connectors, and I simply allowed all IPs to access my Redis instance for now which is obviously not very secure.

I wouldn't like to create a Memorystore instance right now because of the high cost.

Any guidance/links to educational material or documentation are appreciated. Thanks!

Solved Solved
0 5 1,226
1 ACCEPTED SOLUTION

Hi meric,

Yes, a VPC Access Connector is the correct tool for this use case. You can see more here: Cloud Run: Connecting to a VPC network.

View solution in original post