Skip to content

Latest commit

 

History

History

elasticache-redis-cluster

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

elasticache-redis-cluster

This module creates following resources.

  • aws_elasticache_replication_group
  • aws_elasticache_parameter_group (optional)
  • aws_security_group (optional)
  • aws_security_group_rule (optional)

Requirements

Name Version
terraform >= 1.3
aws >= 4.36

Providers

Name Version
aws 4.34.0

Modules

Name Source Version
resource_group tedilabs/misc/aws//modules/resource-group ~> 0.10.0
security_group tedilabs/network/aws//modules/security-group ~> 0.26.0

Resources

Name Type
aws_elasticache_parameter_group.this resource
aws_elasticache_replication_group.this resource

Inputs

Name Description Type Default Required
name (Required) The name of the ElastiCache Redis cluster. This parameter is stored as a lowercase string. string n/a yes
node_instance_type (Required) The instance type to be deployed for the ElastiCache Redis cluster. string n/a yes
apply_immediately (Optional) Whether any modifications are applied immediately, or during the next maintenance window. Default to false. bool false no
auto_failover_enabled (Optional) Whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. If enabled, node_size must be greater than 1. Must be enabled for Redis (cluster mode enabled) cluster. Defaults to false. ElastiCache Auto Failover provides enhanced high availability through automatic failover to a read replica in case of a primary node failover. bool false no
auto_upgrade_minor_version_enabled (Optional) Whether automatically schedule cluster upgrade to the latest minor version, once it becomes available. Cluster upgrade will only be scheduled during the maintenance window. Defaults to true. Only supported if the redis version is 6 or higher. bool true no
backup_enabled (Optional) Whether to automatically create a daily backup of a set of replicas. Defaults to false. bool false no
backup_final_snapshot_name (Optional) The name of your final node group (shard) snapshot. ElastiCache creates the snapshot from the primary node in the cluster. If omitted, no final snapshot will be made. string null no
backup_retention (Optional) The number of days for which automated backups are retained before they are automatically deleted. Valid value is between 1 and 35. Defaults to 1. number 1 no
backup_window (Optional) The daily time range (in UTC) during which ElastiCache will begin taking a daily snapshot of the ElastiCache Redis cluster. The minimum snapshot window is a 60 minute period. Example: 05:00-09:00. Defaults to 16:00-17:00. string "16:00-17:00" no
custom_parameter_group (Optional) The name of the parameter group to associate with the ElastiCache Redis cluster. If this argument is omitted, the default cache parameter group for the specified engine is used. To enable cluster mode (sharding), use a parameter group that has the parameter cluster-enabled set to true. string null no
default_security_group (Optional) The configuration of the default security group for the ElastiCache Redis cluster. default_security_group block as defined below.
(Optional) enabled - Whether to use the default security group. Defaults to true.
(Optional) name - The name of the default security group. If not provided, the cluster name is used for the name of security group.
(Optional) description - The description of the default security group.
(Optional) ingress_rules - A list of ingress rules in a security group. You don't need to specify protocol, from_port, to_port. Just specify source information. Defauls to [{ cidr_blocks = "0.0.0.0/0" }].
object({
enabled = optional(bool, true)
name = optional(string, null)
description = optional(string, "Managed by Terraform.")
ingress_rules = optional(any, [{
cidr_blocks = ["0.0.0.0/0"]
}])
})
{} no
description (Optional) The description of the ElastiCache Redis cluster. string "Managed by Terraform." no
encryption_at_rest The configuration for at-rest encryption of the ElastiCache Redis cluster.
(Optional) enabled - Whether to enable at-rest encryption. Defaults to false.
(Optional) kms_key - The ARN of the key to use for at-rest encryption. If not supplied, uses service managed encryption key. Can be specified only if encryption_at_rest.enabled is true.
object({
enabled = optional(bool, false)
kms_key = optional(string, null)
})
{} no
encryption_in_transit The configuration for in-transit encryption of the ElastiCache Redis cluster.
(Optional) enabled - Whether to enable in-transit encryption. Defaults to false.
object({
enabled = optional(bool, false)
})
{} no
logging_engine_log The configuration for streaming Redis Engine Log of the ElastiCache Redis cluster.
(Optional) enabled - Whether to enable streaming Redis Engine Log. Defaults to false.
(Optional) format - The format of Redis Engine Log. Valid values are JSON or TEXT. Defaults to JSON.
(Optional) destination_type - The destination type for streaming Redis Engine Log. For CloudWatch Logs use CLOUDWATCH_LOGS or for Kinesis Data Firehose use KINESIS_FIREHOSE. Defaults to CLOUDWATCH_LOGS.
(Optional) destination - The name of either the CloudWatch Logs LogGroup or Kinesis Data Firehose resource.
object({
enabled = optional(bool, false)
format = optional(string, "JSON")
destination_type = optional(string, "CLOUDWATCH_LOGS")
destination = optional(string, null)
})
{} no
logging_slow_log The configuration for streaming Redis Slow Log of the ElastiCache Redis cluster.
(Optional) enabled - Whether to enable streaming Redis Slow Log. Defaults to false.
(Optional) format - The format of Redis Slow Log. Valid values are JSON or TEXT. Defaults to JSON.
(Optional) destination_type - The destination type for streaming Redis Slow Log. For CloudWatch Logs use CLOUDWATCH_LOGS or for Kinesis Data Firehose use KINESIS_FIREHOSE. Defaults to CLOUDWATCH_LOGS.
(Optional) destination - The name of either the CloudWatch Logs LogGroup or Kinesis Data Firehose resource.
object({
enabled = optional(bool, false)
format = optional(string, "JSON")
destination_type = optional(string, "CLOUDWATCH_LOGS")
destination = optional(string, null)
})
{} no
maintenance_window (Optional) The weekly time range for when maintenance on the ElastiCache Redis cluster is performed. The format is ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a 60 minute period. Example: sun:05:00-sun:09:00. Defaults to fri:18:00-fri:20:00. string "fri:18:00-fri:20:00" no
module_tags_enabled (Optional) Whether to create AWS Resource Tags for the module informations. bool true no
multi_az_enabled (Optional) Whether to enable Multi-AZ Support for the ElastiCache Redis cluster. If true, auto_failover_enabled must also be enabled. Defaults to false. bool false no
node_size (Optional) The number of cache nodes (primary and replicas) for this ElastiCache Redis cluster will have. If Multi-AZ is enabled, this value must be at least 2. Updates will occur before other modifications. Defaults to 1. number 1 no
notification_sns_topic (Optional) The ARN of an SNS topic to send ElastiCache notifications to. string null no
parameter_group The configuration for parameter group of the ElastiCache Redis cluster.
(Optional) enabled - Whether to enable managed parameter group by this module.
(Optional) name - The name of the managed parameter group. If not provided, the name is configured with the cluster name.
(Optional) description - The description of the managed parameter group.
(Optional) parameters - The key/value set for Redis parameters of ElastiCache Redis cluster. Each key is the name of the redis parameter. Each value is the value of the redis parameter.
object({
enabled = optional(bool, true)
name = optional(string, "")
description = optional(string, "")
parameters = optional(map(string), {})
})
{} no
password (Optional) Password used to access a password protected ElastiCache Redis cluster. Can be specified only if encryption_in_transit.enabled is true. string "" no
port (Optional) The port number on which each of the cache nodes will accept connections. The default port is 6379. number 6379 no
preferred_availability_zones (Optional) A list of AZs(Availability Zones) in which the ElastiCache Redis cluster nodes will be created. The order of the availability zones in the list is considered. The first item in the list will be the primary node. Ignored when updating. list(string) [] no
redis_version (Optional) The version number of Redis to be used for each nodes in the ElastiCache Redis cluster. If the version is 6 or higher, the major and minor version can be set, e.g., 6.2, or the minor version can be unspecified which will use the latest version at creation time, e.g., 6.x. Otherwise, specify the full version desired, e.g., 5.0.6. The actual engine version used is returned in the attribute redis_version_actual. string "7.0" no
resource_group_description (Optional) The description of Resource Group. string "Managed by Terraform." no
resource_group_enabled (Optional) Whether to create Resource Group to find and group AWS resources which are created by this module. bool true no
resource_group_name (Optional) The name of Resource Group. A Resource Group name can have a maximum of 127 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with AWS or aws. string "" no
security_groups (Optional) A list of security group IDs to assign to the instance. list(string) [] no
sharding The configuration for sharding of the ElastiCache Redis cluster.
(Optional) enabled - Whether to enable sharding (cluster mode). It enables replication across multiple shards for enhanced scalability and availability. Defaults to false.
(Optional) shard_size - The number of shards in this cluster. Valid value is from 1 to 500. Defaults to 3.
(Optional) replicas - The number of replicas for each shard. Valid value is from 0 to 5. Defaults to 2.
object({
enabled = optional(bool, false)
shard_size = optional(number, 3)
replicas = optional(number, 2)
})
{} no
source_backup_name (Optional) The name of a snapshot from which to restore data into the new node group. Changing the source_backup_name forces a new resource. string null no
source_rdb_s3_arns (Optional) A list of ARNs that identify Redis RDB snapshot files stored in Amazon S3. The object names cannot contain any commas. list(string) [] no
subnet_group (Optional) The name of the cache subnet group to be used for the ElastiCache Redis cluster. If not provided, configured to use default subnet group in the default VPC. string null no
tags (Optional) A map of tags to add to all resources. map(string) {} no
timeouts (Optional) How long to wait for the instance to be created/updated/deleted.
object({
create = optional(string, "60m")
update = optional(string, "40m")
delete = optional(string, "40m")
})
{} no
user_groups (Optional) A set of User Group IDs to associate with the ElastiCache Redis cluster. Only a maximum of one user group ID is valid. The AWS specification allows for multiple IDs, but AWS only allows a maximum size of one. set(string) [] no
vpc_id (Optional) The ID of the associated VPC. You must provide the vpc_id when default_security_group.enabled is true. It will used to provision the default security group. string null no

Outputs

Name Description
arn The ARN of the ElastiCache Redis cluster.
attributes A set of attributes that applied to the ElastiCache Redis cluster.
auth The configuration for auth of the ElastiCache Redis cluster.
user_groups - A set of User Group IDs to associate with the ElastiCache Redis cluster.
backup The configuration for backup of the ElastiCache Redis cluster.
enabled - Whether to automatically create a daily backup of a set of replicas.
window - The daily time range (in UTC) during which ElastiCache will begin taking a daily snapshot of the ElastiCache Redis cluster.
retention - The number of days for which automated backups are retained before they are automatically deleted.
description The description of the ElastiCache Redis cluster.
encryption The configuration for encryption of the ElastiCache Redis cluster.
at_rest - The configuration for at-rest encryption.
in_transit - The configuration for in-transit encryption.
endpoints The connection endpoints to the ElastiCache Redis cluster.
primary - Address of the endpoint for the primary node in the cluster, if the cluster mode is disabled.
reader - Address of the endpoint for the reader node in the cluster, if the cluster mode is disabled.
configuration - Address of the replication group configuration endpoint when cluster mode is enabled.
id The ID of the ElastiCache Redis cluster.
logging The configuration for logging of the ElastiCache Redis cluster.
slow_log - The configuration for streaming Redis Slow Log.
engine_log - The configuration for streaming Redis Engine Log.
maintenance The configuration for maintenance of the ElastiCache Redis cluster.
window - The weekly time range for when maintenance on the ElastiCache Redis cluster is performed.
auto_upgrade_minor_version_enabled - Whether automatically schedule cluster upgrade to the latest minor version, once it becomes available.
notification_sns_arn - The ARN of an SNS topic to send ElastiCache notifications to.
name The name of the ElastiCache Redis cluster.
network The configuration for network of the ElastiCache Redis cluster.
port - The port number on each cache nodes to accept connections.
subnet_group - The name of the cache subnet group used for.
preferred_availability_zones - The list of AZs(Availability Zones) in which the ElastiCache Redis cluster nodes will be created.
node_instance_type The instance type used for the ElastiCache Redis cluster.
node_size The number of cache nodes (primary and replicas) for this ElastiCache Redis cluster will have.
nodes The list of all nodes are part of the ElastiCache Redis cluster.
parameter_group The name of the parameter group associated with the ElastiCache Redis cluster.
redis_version The version number of Redis used for the ElastiCache Redis cluster. The actual engine version used is returned in redis_version_actual.
redis_version_actual The actual version number of Redis used for the ElastiCache Redis cluster. Because ElastiCache pulls the latest minor or patch for a version, this attribute returns the running version of the cache engine.
sharding The configuration for sharding of the ElastiCache Redis cluster.
source The configuration for source backup of the ElastiCache Redis cluster to restore from.
backup_name - The name of a snapshot from which to restore data into the new node group.
rdb_s3_arns - The list of ARNs that identify Redis RDB snapshot files stored in Amazon S3.