Skip to content
This repository has been archived by the owner on Feb 5, 2021. It is now read-only.
/ terraform-redis Public archive

Terraform module for deploying Redis instances on GCP

License

Notifications You must be signed in to change notification settings

AckeeCZ/terraform-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Moved

Please use repository on new URL : https://github.com/AckeeCZ/terraform-memorystore-redis

Ackee GCE Redis Terraform module

This module is primary written for provisioning of GCE instance from our Redis image (https://github.com/AckeeCZ/packer-redis)

It does a few things :

  • Downloads RAW disk from GCS and create an image from it. (you can generate your own image with Packer using https://github.com/AckeeCZ/packer-redis)
  • Create SSH key for instance provisioning
  • Provision Stackdriver config for redis
  • Create (GCP) firewall rules so GKE pods can reach GCE Redis instances

Configuration

https://github.com/AckeeCZ/terraform-redis/blob/master/variables.tf explanation (followed by default values if applicable) :

  • project - name of GCP project
  • zone - zone of GCP project
  • instance_name - base for GCE instances name
  • cluster_ipv4_cidr - IPv4 CIDR of GKE cluster - for firewall rule setting
  • node_count:1 - number of Redis nodes to deploy
  • raw_image_source - URL of tar archive containing RAW source for Redis image (you can use Packer image template to generate image, as mentioned above)

Usage

module "redis-prod" {
  source = "github.com/AckeeCZ/terraform-redis?ref=v1.0.1"
  project = "my-gcp-project"
  zone = "europe-west3-c"
  instance_name = "redis-prod"
  cluster_ipv4_cidr = "10.123.0.0/14"
  node_count = "3"
  raw_image_source = "https://storage.googleapis.com/image-bucket/ackee-redis5.0-disk-latest.tar.gz"
}