Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/geekcell/terraform-aws-elasticache-redis-cluster

Terraform module to provision an AWS ElastiCache Redis Cluster.
https://github.com/geekcell/terraform-aws-elasticache-redis-cluster

aws elasticache redis redis-cluster terraform terraform-module

Last synced: 13 days ago
JSON representation

Terraform module to provision an AWS ElastiCache Redis Cluster.

Awesome Lists containing this project

README

        

[![Geek Cell GmbH](https://raw.githubusercontent.com/geekcell/.github/main/geekcell-github-banner.png)](https://www.geekcell.io/)

### Code Quality
[![License](https://img.shields.io/github/license/geekcell/terraform-aws-elasticache-redis-cluster)](https://github.com/geekcell/terraform-aws-elasticache-redis-cluster/blob/master/LICENSE)
[![GitHub release (latest tag)](https://img.shields.io/github/v/release/geekcell/terraform-aws-elasticache-redis-cluster?logo=github&sort=semver)](https://github.com/geekcell/terraform-aws-elasticache-redis-cluster/releases)
[![Release](https://github.com/geekcell/terraform-aws-elasticache-redis-cluster/actions/workflows/release.yaml/badge.svg)](https://github.com/geekcell/terraform-aws-elasticache-redis-cluster/actions/workflows/release.yaml)
[![Validate](https://github.com/geekcell/terraform-aws-elasticache-redis-cluster/actions/workflows/validate.yaml/badge.svg)](https://github.com/geekcell/terraform-aws-elasticache-redis-cluster/actions/workflows/validate.yaml)
[![Lint](https://github.com/geekcell/terraform-aws-elasticache-redis-cluster/actions/workflows/linter.yaml/badge.svg)](https://github.com/geekcell/terraform-aws-elasticache-redis-cluster/actions/workflows/linter.yaml)
[![Test](https://github.com/geekcell/terraform-aws-elasticache-redis-cluster/actions/workflows/test.yaml/badge.svg)](https://github.com/geekcell/terraform-aws-elasticache-redis-cluster/actions/workflows/test.yaml)

### Security
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-elasticache-redis-cluster/general)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-elasticache-redis-cluster&benchmark=INFRASTRUCTURE+SECURITY)

#### Cloud
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-elasticache-redis-cluster/cis_aws)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-elasticache-redis-cluster&benchmark=CIS+AWS+V1.2)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-elasticache-redis-cluster/cis_aws_13)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-elasticache-redis-cluster&benchmark=CIS+AWS+V1.3)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-elasticache-redis-cluster/cis_azure)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-elasticache-redis-cluster&benchmark=CIS+AZURE+V1.1)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-elasticache-redis-cluster/cis_azure_13)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-elasticache-redis-cluster&benchmark=CIS+AZURE+V1.3)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-elasticache-redis-cluster/cis_gcp)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-elasticache-redis-cluster&benchmark=CIS+GCP+V1.1)

##### Container
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-elasticache-redis-cluster/cis_kubernetes_16)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-elasticache-redis-cluster&benchmark=CIS+KUBERNETES+V1.6)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-elasticache-redis-cluster/cis_eks_11)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-elasticache-redis-cluster&benchmark=CIS+EKS+V1.1)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-elasticache-redis-cluster/cis_gke_11)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-elasticache-redis-cluster&benchmark=CIS+GKE+V1.1)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-elasticache-redis-cluster/cis_kubernetes)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-elasticache-redis-cluster&benchmark=CIS+KUBERNETES+V1.5)

#### Data protection
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-elasticache-redis-cluster/soc2)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-elasticache-redis-cluster&benchmark=SOC2)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-elasticache-redis-cluster/pci)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-elasticache-redis-cluster&benchmark=PCI-DSS+V3.2)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-elasticache-redis-cluster/pci_dss_v321)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-elasticache-redis-cluster&benchmark=PCI-DSS+V3.2.1)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-elasticache-redis-cluster/iso)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-elasticache-redis-cluster&benchmark=ISO27001)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-elasticache-redis-cluster/nist)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-elasticache-redis-cluster&benchmark=NIST-800-53)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-elasticache-redis-cluster/hipaa)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-elasticache-redis-cluster&benchmark=HIPAA)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-elasticache-redis-cluster/fedramp_moderate)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-elasticache-redis-cluster&benchmark=FEDRAMP+%28MODERATE%29)

Terraform AWS Elasticache Redis

Introducing the AWS ElastiCache Redis Cluster Terraform Module, a highly efficient solution for creating and managing
your Redis clusters within Amazon Web Services (AWS). This module has been expertly crafted to provide you with a
simple and streamlined way to create and manage your Redis clusters within AWS ElastiCache.

Our team of experts has years of experience working with AWS ElastiCache and has a deep understanding of the best
practices and configurations. By using this Terraform module, you can be sure that your Redis clusters are created
and managed in a secure, efficient, and scalable manner.

This module offers a preconfigured solution for creating Redis clusters, saving you time and effort in the process.
Whether you're looking to improve the performance of your applications or to implement a highly available and
scalable cache, this module has you covered.

So, if you're looking for a convenient and reliable solution for creating and managing your Redis clusters within
AWS ElastiCache, look no further than the AWS ElastiCache Redis Cluster Terraform Module. Give it a try and see the
difference it can make in your AWS setup!

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [apply\_immediately](#input\_apply\_immediately) | Specifies whether any modifications are applied immediately, or during the next maintenance window. | `bool` | `true` | no |
| [at\_rest\_encryption\_enabled](#input\_at\_rest\_encryption\_enabled) | Whether to enable encryption at rest. | `bool` | `true` | no |
| [auth\_token\_length](#input\_auth\_token\_length) | The length of the generated auth token. | `number` | `24` | no |
| [auth\_token\_special\_characters](#input\_auth\_token\_special\_characters) | Whether to include special characters in the generated auth token. | `bool` | `false` | no |
| [auto\_minor\_version\_upgrade](#input\_auto\_minor\_version\_upgrade) | Specifies whether minor version engine upgrades will be applied automatically to the underlying Cache Cluster instances during the maintenance window. | `string` | `false` | no |
| [data\_tearing\_enabled](#input\_data\_tearing\_enabled) | Enables data tiering. Data tiering is only supported for replication groups using the r6gd node type. | `bool` | `false` | no |
| [description](#input\_description) | The description of the all resources. | `string` | `"Managed by Terraform"` | no |
| [enable\_customer\_managed\_kms](#input\_enable\_customer\_managed\_kms) | If enabled, will create a customer managed KMS key for at-rest encryption. | `bool` | `false` | no |
| [enable\_sns\_sse\_encryption](#input\_enable\_sns\_sse\_encryption) | Enable SSE Encryption for SNS Topic. | `bool` | `true` | no |
| [engine](#input\_engine) | Name of the cache engine to be used for the clusters in this replication group. | `string` | `"redis"` | no |
| [engine\_version](#input\_engine\_version) | The version number of the cache engine to be used for the cache clusters in this replication group. | `string` | `"7.0"` | no |
| [kms\_key\_id](#input\_kms\_key\_id) | The ARN of the AWS KMS to encrypt data at rest. Uses the AWS service managed encryption if not specified. | `string` | `null` | no |
| [log\_destination\_type](#input\_log\_destination\_type) | For CloudWatch Logs use `cloudwatch-logs` or for Kinesis Data Firehose use `kinesis-firehose`. Only 'cloudwatch-logs' supported at the moment. | `string` | `"cloudwatch-logs"` | no |
| [log\_enable\_customer\_managed\_kms](#input\_log\_enable\_customer\_managed\_kms) | Whether to enable customer managed KMS key for CloudWatch Logs encryption. | `bool` | `false` | no |
| [log\_format](#input\_log\_format) | Valid values are `json` or `text`. | `string` | `"text"` | no |
| [log\_retention\_in\_days](#input\_log\_retention\_in\_days) | The number of days log events are kept in CloudWatch Logs. | `number` | `30` | no |
| [log\_skip\_destroy](#input\_log\_skip\_destroy) | Whether to skip the deletion of the log groups when deleting the log group resources. | `bool` | `false` | no |
| [log\_type](#input\_log\_type) | Type of logs, slow-log and engine-log | `list(string)` |

[
"slow-log",
"engine-log"
]
| no |
| [maintenance\_window](#input\_maintenance\_window) | Specifies the weekly time range for when maintenance on the cache cluster is performed. | `string` | `"Mon:00:00-Mon:03:00"` | no |
| [node\_type](#input\_node\_type) | The cluster identifier. If omitted, Terraform will assign a random, unique identifier. | `string` | n/a | yes |
| [num\_cache\_clusters](#input\_num\_cache\_clusters) | 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 | `number` | n/a | yes |
| [parameter\_group\_family](#input\_parameter\_group\_family) | The family of the ElastiCache parameter group. Defaults to engine and engine\_version. | `string` | `null` | no |
| [parameter\_group\_name](#input\_parameter\_group\_name) | The name of the ElastiCache parameter group. Defaults to the cluster name. | `string` | `null` | no |
| [parameters](#input\_parameters) | Set custom parameters via a parameter group. |
list(object({
name = string
value = string
}))
| `[]` | no |
| [port](#input\_port) | Port number on which each of the cache nodes will accept connections. | `number` | `6379` | no |
| [replication\_group\_id](#input\_replication\_group\_id) | ID of the replication group to which this cluster should belong. | `string` | n/a | yes |
| [security\_group\_ids](#input\_security\_group\_ids) | A list of security group IDs to associate with this replication group. | `list(string)` | n/a | yes |
| [snapshot\_retention\_limit](#input\_snapshot\_retention\_limit) | Number of days for which ElastiCache will retain automatic cache cluster snapshots before deleting them. | `number` | `7` | no |
| [snapshot\_window](#input\_snapshot\_window) | Daily time range (in UTC) during which ElastiCache will begin taking a daily snapshot of your cache cluster. | `string` | `"03:30-05:30"` | no |
| [sns\_event\_recipients](#input\_sns\_event\_recipients) | Recipients of the ElastiCache SNS event topic. Should be a list of E-Mails. | `list(string)` | `[]` | no |
| [sns\_kms\_master\_key\_id](#input\_sns\_kms\_master\_key\_id) | The ID of an AWS KMS key for the SNS topic. | `string` | `"alias/aws/sns"` | no |
| [tags](#input\_tags) | A mapping of tags to assign to all resources. | `map(string)` | `{}` | no |
| [transit\_encryption\_enabled](#input\_transit\_encryption\_enabled) | Whether to enable encryption in transit. | `bool` | `true` | no |
| [vpc\_subnet\_group\_name](#input\_vpc\_subnet\_group\_name) | Subnet group name for the Elasticache cluster. | `string` | n/a | yes |

## Outputs

| Name | Description |
|------|-------------|
| [auth\_token](#output\_auth\_token) | The generate auth token used to access the Redis cluster. |
| [primary\_endpoint\_address](#output\_primary\_endpoint\_address) | Address of the endpoint for the primary node in the replication group, if the cluster mode is disabled. |
| [reader\_endpoint\_address](#output\_reader\_endpoint\_address) | Address of the endpoint for the reader node in the replication group, if the cluster mode is disabled. |

## Providers

| Name | Version |
|------|---------|
| [aws](#provider\_aws) | >= 4.4 |
| [random](#provider\_random) | >= 3.0 |

## Resources

- resource.aws_elasticache_replication_group.redis (main.tf#20)
- resource.random_password.main_password (main.tf#85)

# Examples
### Basic Example
```hcl
module "vpc" {
source = "registry.terraform.io/terraform-aws-modules/vpc/aws"
version = "~> 5.0.0"

name = "${var.name}-main"
cidr = "10.100.0.0/16"
azs = ["eu-central-1a", "eu-central-1b"]
private_subnets = ["10.100.1.0/24", "10.100.2.0/24"]
elasticache_subnets = ["10.100.10.0/24", "10.100.11.0/24"]
}

module "redis_security_group" {
source = "geekcell/security-group/aws"
version = ">= 1.0.0, < 2.0.0"

name = "${var.name}-redis"
vpc_id = module.vpc.vpc_id
}

module "basic-example" {
source = "../../"

replication_group_id = var.name
node_type = "cache.t4g.micro"
num_cache_clusters = 2
security_group_ids = [module.redis_security_group.security_group_id]
vpc_subnet_group_name = module.vpc.elasticache_subnet_group_name
}
```