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!

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.

Apparently I need a VPC Access Connector even if I am connecting to a memorystore instance so I’ll either way set that up. Thanks for the response :raising_hands:

So I did create a memorystore instance as well as a VPC Access connector but it still doesn’t work. What am I doing wrong :thinking: @cloudpaul appreciate if you can take a look :folded_hands: Should I have maybe entered something else for the subnet / IP address range for the connector?

cloud run config (Region: europe-west1)

Connector:

Memorystore config:

By “doesn’t work” I mean:

Hi meric,

Dou you have an ingress Firewall Rule allowing traffic from Serverless VPC Connector IP range in default VPC?.