Skip to content

Files

Latest commit

9a0b5e0 · Jun 14, 2022

History

History
22 lines (13 loc) · 909 Bytes

README.md

File metadata and controls

22 lines (13 loc) · 909 Bytes

Run on Google Cloud

cloud-run-vpc-redis

Example of connecting a Cloud Run service to Redis via a VPC connector

Redis is used to keep track of the last load of the site and stores the last viewer's browser name and version. When a new person loads the page they see their own browser name and version, plus the info from the last person to load the site.

Setup

You'll need:

  1. GCP Memorystore running redis
  2. A Serverless VPC Connector to connect your Cloud Run service to Redis
  3. REDISTHOST environment variable setup for your Cloud Run service to reference your Memorystore Redis
Environment Variable Example value
REDISHOST 10.10.10.10

Image