Code Monkey home page Code Monkey logo

terraform-elasticache's Introduction

terraform-elasticache

Terraform modules to set up redis and memcache.

redis

This creates a redis cluster with some default values and creates a security group for the cluster that allows a specific security group to access the redis cluster

Available variables:

Name Description Type Default Required
allowed_sgs The security group that can access the redis cluster list(string) n/a yes
at_rest_encryption_enabled (Optional) Whether to enable encryption at rest bool true no
auth_token (Optional) The password used to access a password protected server. Can be specified only if transit_encryption_enabled = true string null no
automatic_failover_enabled n/a bool false no
availability_zones the list of AZs where you want your cluster to be deployed in list(string) n/a yes
cloudwatch_logging_enabled (Optional) Whether to enable cloudwatch logging bool false no
cloudwatch_logging_retention_in_days Retention period for the logs in CloudWatch. Default is 7d. number 7 no
engine_version The redis engine version string "3.2.6" no
environment How do you want to call your environment string n/a yes
multi_az_enabled n/a bool false no
name The name of the redis cluster string n/a yes
node_type The instance size of the redis cluster string n/a yes
notification_topic_arn (Optional) ARN of an SNS topic to send ElastiCache notifications string null no
num_cache_nodes The number of cache nodes number n/a yes
parameter_group_name The parameter group name string "default.redis3.2" no
port The redis port number 6379 no
project The project this redis cluster belongs to string n/a yes
snapshot_arns (Optional) A single-element string list containing an Amazon Resource Name (ARN) of a Redis RDB snapshot file stored in Amazon S3. Example: arn:aws:s3:::my_bucket/snapshot1.rdb list(string) [] no
snapshot_retention_limit The number of days for which ElastiCache will retain automatic cache cluster snapshots before deleting them. For example, if you set SnapshotRetentionLimit to 5, then a snapshot that was taken today will be retained for 5 days before being deleted. If the value of SnapshotRetentionLimit is set to zero (0), backups are turned off. Please note that setting a snapshot_retention_limit is not supported on cache.t1.micro or cache.t2.* cache nodes number 0 no
snapshot_window The daily time range (in UTC) during which ElastiCache will begin taking a daily snapshot of your cache cluster. The minimum maintenance window is a 60 minute period. Example: 05:00-09:00 string "03:00-05:00" no
subnets The subnets where the redis cluster is deployed list(string) n/a yes
transit_encryption_enabled (Optional) Whether to enable encryption in transit bool true no
vpc_id The vpc where we will put the redis cluster string n/a yes

Output

Name Description
configuration_endpoint_address n/a
primary_endpoint_address n/a
redis_sg n/a

Example

module "redis" {
  source          = "github.com/skyscrapers/terraform-elasticache//redis"
  name            = "redis"
  project         = var.project
  environment     = terraform.workspace
  node_type       = "cache.t3.small"
  num_cache_nodes = "1"
  subnets         = module.vpc.private_db_subnets
  allowed_sgs     = [module.app.sg_id]
  vpc_id          = module.vpc.vpc_id
}

memcache

Available variables

Name Description Type Default Required
allowed_sgs The security group that can access the memcache cluster list(string) n/a yes
environment How do you want to call your environment string n/a yes
name The name of the memcache cluster string n/a yes
node_type The instance size of the memcache cluster string n/a yes
num_cache_nodes The number of cache nodes number n/a yes
project The project this memcache cluster belongs to string n/a yes
subnets The subnets where the memcache cluster is deployed list(string) n/a yes
vpc_id The vpc where we will put the memcache cluster string n/a yes
engine_version The memcache engine version string "1.4.5" no
parameter_group_name The parameter group name string "default.memcached1.4" no
port The memcache port number 11211 no

Output

Name Description
memcache_endpoint The DNS name of the memcache cluster
memcache_sg The security group ID of the memcache cluster.

Example

module "memcache" {
  source          = "github.com/skyscrapers/terraform-elasticache//memcache"
  name            = "memcache"
  project         = var.project
  environment     = terraform.workspace
  node_type       = "cache.t3.small"
  num_cache_nodes = "1"
  subnets         = module.vpc.private_db_subnets
  vpc_id          = module.vpc.vpc_id
  allowed_sgs     = [module.app.sg_id]
}

terraform-elasticache's People

Contributors

duboisph avatar iuriaranda avatar minniux avatar reyntjensw avatar simonrondelez avatar venturel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

terraform-elasticache's Issues

Replication group id's are limited to 20 chars

I was attempting to use this module in my terraform setup - and I received an error saying that the replication group id is limited to 20 characters.

Looking at the source, the id is configured as a combination of the project, the environment, and the name. If the environment is fully typed out - e.g. development or production, this 20-character limit is quickly filled up.

What if there was an additional variable added that could specify the id manually - and if the id wasn't manually specified then it would use what it currently uses (the combination of name, env, and project). The description would continue to have the full output of name-environment-project.

I'm willing to create a PR for it - just wanted to make sure it's an OK solution ๐Ÿ˜

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.