Skip to content

Latest commit

 

History

History
187 lines (104 loc) · 3.57 KB

README.md

File metadata and controls

187 lines (104 loc) · 3.57 KB

INF-tf-elasticache redis cluster

Terraform module for creating a aws elasticache redis cluster

NOTE: keep the names short, since the maximum length for the name is 20

NOTE: aws redis sdk needed to connect to the cluster

This project is internal open source and currently maintained by the INF.

Requirements

The following requirements are needed by this module:

  • terraform (>= 0.12)

Providers

The following providers are used by this module:

  • aws

Required Inputs

The following input variables are required:

domain

Description: the module creates a route53 domain entry and therefore need the domain in which the entry should be created

Type: string

environment

Description: the environment this cache is running in (e.g. 'testing')

Type: string

subnet_ids

Description: a list of subnet ids in which the ASG deploys to

Type: list(string)

vpc_id

Description: the VPC the ASG should be deployed in

Type: string

Optional Inputs

The following input variables are optional (have default values):

application_port

Description: port the service licenses to

Type: number

Default: 6379

csgs

Description: security groups which get added to the security group as ingress

Type: list(string)

Default: []

description

Description: description which is beeing displayed in the console

Type: string

Default: ""

engine_version

Description: redis version to run

Type: string

Default: "3.2.10"

hostname

Description: hostname of the redis

Type: string

Default: "redis"

node_type

Description: type of machine to run on

Type: string

Default: "cache.t2.small"

num_node_groups

Description: Specify the number of node groups (shards) for this Redis replication group

Type: number

Default: 2

parameter_group_name

Description: parameter group for the redis

Type: string

Default: "default.redis3.2.cluster.on"

replicas_per_node_group

Description: Specify the number of replica nodes in each node group. Valid values are 0 to 5.

Type: number

Default: 1

short_name_length

Description: desired string length which is applied to various naming strings, to make the names shorter

Type: number

Default: 4

tags

Description: common tags to add to the ressources

Type: map(string)

Default: {}

Outputs

The following outputs are exported:

config_endpoint

Description: cluster configuration endpoint (needed for aws redis sdk)

database_fqdn

Description: fqdn created from domain and hostname

sg

Description: SG which is attached to the service

sg_intra

Description: an intra SG, intended to added to EC2 instsances for access (DEPRECATED)

Usage

module "redis_cluster" {
  source      = "github.com/ryte/INF-tf-elasticache//redis/cluster?ref=v0.2.2"
  tags        = local.common_tags
  environment = var.environment

  domain                  = var.domain
  engine_version          = "5.0.5"
  description             = "Redis Cluster"
  config_hostname         = "rediscluster"
  parameter_group_name    = "default.redis5.0.cluster.on"
  application_port        = 6379
  node_type               = "cache.t3.small"
  replicas_per_node_group = 1
  num_node_groups         = 2
  vpc_id                  = data.terraform_remote_state.vpc.vpc_id
  subnet_ids              = data.terraform_remote_state.vpc.subnet_private
  csgs                    = []
}