All Projects → clouddrove → terraform-aws-elasticache

clouddrove / terraform-aws-elasticache

Licence: MIT License
Terraform module to create Elasticache Cluster and replica for Redis and Memcache.

Programming Languages

HCL
1544 projects
go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to terraform-aws-elasticache

terraform-aws-ecr
This terraform module is used to create ECR on AWS.
Stars: ✭ 20 (+5.26%)
Mutual labels:  module, hcl, clouddrove, terrafom-modules
terraform-aws-s3
Terraform module to create default S3 bucket with logging and encryption type specific features.
Stars: ✭ 22 (+15.79%)
Mutual labels:  module, clouddrove, terrafom-modules
Terraform Aws Airship Ecs Service
Terraform module which creates an ECS Service, IAM roles, Scaling, ALB listener rules.. Fargate & AWSVPC compatible
Stars: ✭ 139 (+631.58%)
Mutual labels:  module, hcl
RedisTree
Redis Tree (Ploytree) Structure Module
Stars: ✭ 64 (+236.84%)
Mutual labels:  module, redis-module
terraform-aws-sftp
This terraform module is used to create sftp on AWS for S3.
Stars: ✭ 20 (+5.26%)
Mutual labels:  hcl, clouddrove
Git-API
Gets info from github and transfers into json styled data
Stars: ✭ 18 (-5.26%)
Mutual labels:  module
yii2-logreader
Yii2 Log Reader
Stars: ✭ 31 (+63.16%)
Mutual labels:  module
ejabberd mod apns
An ejabberd module to send PUSH messages to iOS devices through APNS
Stars: ✭ 31 (+63.16%)
Mutual labels:  module
MAGNETAR
Device Performance Optimizer — Aims To Provide An Optimal Experience At Every Usage Scenario
Stars: ✭ 82 (+331.58%)
Mutual labels:  module
surge
Network toolbox Surge rules, modules and configuration files, For pure self use.
Stars: ✭ 207 (+989.47%)
Mutual labels:  module
core
augejs is a progressive Node.js framework for building applications. https://github.com/augejs/augejs.github.io
Stars: ✭ 18 (-5.26%)
Mutual labels:  module
Magento2-Admin-Module-Sample
Minimal code to create an admin/backend module in Magento2
Stars: ✭ 45 (+136.84%)
Mutual labels:  module
FormatPx
Better Formatting in PowerShell
Stars: ✭ 63 (+231.58%)
Mutual labels:  module
hwt
VHDL/Verilog/SystemC code generator, simulator API written in python/c++
Stars: ✭ 145 (+663.16%)
Mutual labels:  hcl
polybar-dwm-module
A dwm module for polybar
Stars: ✭ 91 (+378.95%)
Mutual labels:  module
JlContentFieldsFilter
Модуль фильтрации материалов Joomla по дополнительным полям
Stars: ✭ 20 (+5.26%)
Mutual labels:  module
magisk-frida
You are probably looking for: https://github.com/ViRb3/magisk-frida
Stars: ✭ 47 (+147.37%)
Mutual labels:  module
java9-module-examples
a list of Java 9 module samples to dive into the modular world
Stars: ✭ 25 (+31.58%)
Mutual labels:  module
DebugPx
PowerShell Debugging Toolkit (feat. the breakpoint and ifdebug commands)
Stars: ✭ 41 (+115.79%)
Mutual labels:  module
refmt
Reformat HCL ⇄ JSON ⇄ YAML.
Stars: ✭ 19 (+0%)
Mutual labels:  hcl

Terraform AWS Elasticache

Terraform module to create Elasticache Cluster and replica for Redis and Memcache.

Terraform Licence


We eat, drink, sleep and most importantly love DevOps. We are working towards strategies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy Bigger problems are always solved by breaking them into smaller manageable problems. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller connected yet manageable pieces within the infrastructure.

This module is basically combination of Terraform open source and includes automatation tests and examples. It also helps to create and improve your infrastructure with minimalistic code instead of maintaining the whole infrastructure code yourself.

We have fifty plus terraform modules. A few of them are comepleted and are available for open source usage while a few others are in progress.

Prerequisites

This module has a few dependencies:

Examples

IMPORTANT: Since the master branch used in source varies based on new modifications, we suggest that you use the release versions here.

Here are some examples of how you can use this module in your inventory structure:

Redis

    module "redis" {
    source                       = "clouddrove/elasticache/aws
    version                      = "0.15.0"
    name                         = "redis"
    environment                  = "test"
    label_order                  = ["environment", "name"]
    engine                       = "redis"
    engine_version               = "5.0.0"
    family                       = "redis5.0"
    port                         = 6379
    node_type                    = "cache.t2.micro"
    subnet_ids                   = ["subnet-xxxxxxx","subnet-xxxxxxx","subnet-xxxxxxx"]
    security_group_ids           = ["sg-xxxxxxxxx"]
    availability_zones           = ["eu-west-1a","eu-west-1b" ]
    auto_minor_version_upgrade   = true
    number_cache_clusters        = 2
   }

Redis Cluster

    module "redis-cluster" {
    source                      = "clouddrove/elasticache/aws
    version                     = "0.15.0"
    name                        = "cluster"
    environment                 = "test"
    label_order                 = ["environment","name"]
    cluster_replication_enabled = true
    engine                      = "redis"
    engine_version              = "5.0.0"
    family                      = "redis5.0"
    port                        = 6379
    node_type                   = "cache.t2.micro"
    subnet_ids                  = module.subnets.public_subnet_id
    security_group_ids          = [module.redis-sg.security_group_ids]
    availability_zones          = ["eu-west-1a","eu-west-1b" ]
    auto_minor_version_upgrade  = true
    replicas_per_node_group     = 2
    num_node_groups             = 1
    automatic_failover_enabled  = true
  }

Memcache

    module "memcached" {
    source                       = "clouddrove/elasticache/aws
    version                      = "0.15.0"
    name                         = "memcached"
    environment                  = "test"
    label_order                  = ["environment", "name"]
    cluster_enabled              = true
    engine                       = "memcached"
    engine_version               = "1.5.10"
    family                       = "memcached1.5"
    parameter_group_name         = "default.memcached1.5"
    az_mode                      = "cross-az"
    port                         = 11211
    node_type                    = "cache.t2.micro"
    num_cache_nodes              = 2
    subnet_ids                   = ["subnet-xxxxxxx","subnet-xxxxxxx","subnet-xxxxxxx"]
    security_group_ids           = ["sg-xxxxxxxxx"]
    availability_zones           = ["eu-west-1a","eu-west-1b" ]
    }

Inputs

Name Description Type Default Required
apply_immediately Specifies whether any modifications are applied immediately, or during the next maintenance window. Default is false. bool false no
at_rest_encryption_enabled Enable encryption at rest. bool true no
attributes Additional attributes (e.g. 1). list(any) [] no
auth_token The password used to access a password protected server. Can be specified only if transit_encryption_enabled = true. string "gihweisdjhewiuei" no
auto_minor_version_upgrade Specifies whether a minor engine upgrades will be applied automatically to the underlying Cache Cluster instances during the maintenance window. Defaults to true. bool true no
automatic_failover_enabled Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. If true, Multi-AZ is enabled for this replication group. If false, Multi-AZ is disabled for this replication group. Must be enabled for Redis (cluster mode enabled) replication groups. Defaults to false. bool false no
availability_zones A list of EC2 availability zones in which the replication group's cache clusters will be created. The order of the availability zones in the list is not important. list(string) n/a yes
az_mode (Memcached only) Specifies whether the nodes in this Memcached node group are created in a single Availability Zone or created across multiple Availability Zones in the cluster's region. Valid values for this parameter are single-az or cross-az, default is single-az. If you want to choose cross-az, num_cache_nodes must be greater than 1. string "single-az" no
cluster_enabled (Memcache only) Enabled or disabled cluster. bool false no
cluster_replication_enabled (Redis only) Enabled or disabled replication_group for redis cluster. bool false no
description Description for the cache subnet group. Defaults to Managed by Terraform. string "Managed by Terraform" no
enable Enable or disable of elasticache bool true no
engine The name of the cache engine to be used for the clusters in this replication group. e.g. redis. string "" no
engine_version The version number of the cache engine to be used for the cache clusters in this replication group. string "" no
environment Environment (e.g. prod, dev, staging). string "" no
extra_tags Additional tags (e.g. map(BusinessUnit,XYZ). map(string) {} no
family (Required) The family of the ElastiCache parameter group. string "" no
kms_key_id The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. Can be specified only if at_rest_encryption_enabled = true. string "" no
label_order Label order, e.g. name,application. list(any) [] no
maintenance_window Maintenance window. string "sun:05:00-sun:06:00" no
managedby ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'. string "[email protected]" no
name Name (e.g. app or cluster). string "" no
node_type The compute and memory capacity of the nodes in the node group. string "cache.t2.small" no
notification_topic_arn An Amazon Resource Name (ARN) of an SNS topic to send ElastiCache notifications to. string "" no
num_cache_nodes (Required unless replication_group_id is provided) The initial number of cache nodes that the cache cluster will have. For Redis, this value must be 1. For Memcache, this value must be between 1 and 20. If this number is reduced on subsequent runs, the highest numbered nodes will be removed. number 1 no
num_node_groups Number of Shards (nodes). string "" no
number_cache_clusters (Required for Cluster Mode Disabled) The number of cache clusters (primary and replicas) this replication group will have. If Multi-AZ is enabled, the value of this parameter must be at least 2. Updates will occur before other modifications. string "" no
parameter_group_name The name of the parameter group to associate with this replication group. If this argument is omitted, the default cache parameter group for the specified engine is used. string "default.redis5.0" no
port the port number on which each of the cache nodes will accept connections. string "" no
replicas_per_node_group Replicas per Shard. string "" no
replication_enabled (Redis only) Enabled or disabled replication_group for redis standalone instance. bool false no
replication_group_id The replication group identifier This parameter is stored as a lowercase string. string "" no
repository Terraform current module repo string "https://github.com/clouddrove/terraform-aws-elasticache" no
security_group_ids One or more VPC security groups associated with the cache cluster. list [] no
security_group_names A list of cache security group names to associate with this replication group. any null no
snapshot_arns A single-element string list containing an Amazon Resource Name (ARN) of a Redis RDB snapshot file stored in Amazon S3. any null no
snapshot_name The name of a snapshot from which to restore data into the new node group. Changing the snapshot_name forces a new resource. string "" no
snapshot_retention_limit (Redis only) 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. string "0" no
snapshot_window (Redis only) The daily time range (in UTC) during which ElastiCache will begin taking a daily snapshot of your cache cluster. The minimum snapshot window is a 60 minute period. any null no
subnet_ids List of VPC Subnet IDs for the cache subnet group. list [] no
transit_encryption_enabled Whether to enable encryption in transit. bool true no

Outputs

Name Description
id Redis cluster id.
memcached_endpoint Memcached endpoint address.
port Redis port.
redis_endpoint Redis endpoint address.
tags A mapping of tags to assign to the resource.

Testing

In this module testing is performed with terratest and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a GO environment in your system.

You need to run the following command in the testing folder:

  go test -run Test

Feedback

If you come accross a bug or have any feedback, please log it in our issue tracker, or feel free to drop us an email at [email protected].

If you have found it worth your time, go ahead and give us a ★ on our GitHub!

About us

At CloudDrove, we offer expert guidance, implementation support and services to help organisations accelerate their journey to the cloud. Our services include docker and container orchestration, cloud migration and adoption, infrastructure automation, application modernisation and remediation, and performance engineering.

We are The Cloud Experts!


We ❤️ Open Source and you can check out our other modules to get help with your new Cloud ideas.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].