AWS ElastiCache Terraform Module

Terraform module to provision ElastiCache on AWS.

Usage

Simple setup

Create a simple Elasticache Cluster (redis) with default configurations.

    module "elasticache" {
        source                     = "app.terraform.io/ncodelibrary/elasticache/aws"
        version                    = "0.1.2"
        public_subnets_ids         = ["subnet-xxxxxxxxxxxx", "subnet-xxxxxxxxxxx"]
        identifier                 = "example"
        sg_redis                   = ["sg-xxxxxxxxxxxx"]
        vpc_id                     = "vpc-xxxxxxxxxx"
        tags                       = {
            Owner       = "sysops"
            env         = "dev"
            Cost_Center = "XYZ"
        }
    }

For more details on a working example, please visit examples/simple

Advanced Setup

Create a simple Elasticache Cluster (memcached) with advanced configurations.

    module "elasticache" {
        source                     = "app.terraform.io/ncodelibrary/elasticache/aws"
        version                    = "0.1.2"
        public_subnets_ids         = ["subnet-xxxxxxxxxxxx", "subnet-xxxxxxxxxxx"]
        identifier                 = "example"
        sg_redis                   = ["sg-xxxxxxxxxxxx"]
        vpc_id                     = "vpc-xxxxxxxxxx"
        elasticache_engine         = "memcached"
        elasticache_engine_version = "1.6.6"
        parameter_group_name       = "default.memcached1.6"
        elasticache_instance_type  = "cache.t2.small"
        maintenance_window         = "sun:13:00-sun:14:00"
        port                       = 11211
        num_cache_nodes            = 2
        tags                       = {
            Owner       = "sysops"
            env         = "dev"
            Cost_Center = "XYZ"
        }
    }

For more options refer to a working example at examples/advanced

Examples

Here are some working examples of using this module:

Requirements

No requirements.

Providers

Name Version
aws n/a

Modules

No Modules.

Resources

Name
aws_elasticache_cluster
aws_elasticache_subnet_group

Inputs

Name Description Type Default Required
append_workspace Appends the terraform workspace at the end of resource names, - bool true no
elasticache_engine Define the Elasticache engine to be used string "redis" no
elasticache_engine_version Define the Elasticache Redis engine version string "4.0.10" no
elasticache_instance_type Define the instance size string "cache.t2.small" no
identifier Define an identifier/name for the cluster string n/a yes
maintenance_window Define the Maintenance Window string "wed:13:00-wed:14:00" no
num_cache_nodes Number of cache nodes needed number 1 no
parameter_group_name Parameter Group for the redis cluster string "default.redis4.0" no
port Define the port to be used for Elasticache Redis number 6379 no
public_subnets_ids List of subnets for the resource network scope list n/a yes
sg_redis security group for redis list(string) n/a yes
tags Tags to be applied to the resource map {} no
vpc_id Define ID of the VPC where cluster is to be created string n/a yes

Outputs

Name Description
output n/a

Contributing

If you want to contribute to this repository check all the guidelines specified here before submitting a new PR.