DoiT Cloud Intelligence™

Connecting Cloud Functions To Redis (Memorystore) With Serverless VPC Connector

By Mike SparrJun 9, 20201 min read
Connecting Cloud Functions To Redis (Memorystore) With Serverless VPC Connector

If you’re like me and you just want answers now, it can cause unnecessary toil having to bounce from article to article just to get something to work. I recently experienced this while helping a company connect their cloud functions to Redis. Google’s documentation is pretty awesome and improving all the time, but sometimes those engineering principles of factoring make them difficult to follow.

Long story short, here are the steps below that work based on the example documentation.

Working cloud function connecting to Redis

Of course you will want to replace the project ID and other variables at the top, but I hope this helps simplify getting your cloud functions interacting with Redis (Memorystore) using serverless VPC connector.

Cleanup

If you are just trying out Cloud Functions and Redis (Memorystore), then don’t forget to delete the resources you create to avoid unnecessary expenses. The simplest way is just to delete the project.

Below are the steps to reverse the example above just in case you need them.