Skip to content

dasmeta/terraform-aws-elasticache

Repository files navigation

terraform-aws-elasticache

this module allows to create aws elasticache/redis cluster

basic example

module "redis" {
  source  = "dasmeta/elasticache/aws"
  version = "x.y.z"

  name         = "test-redis"
  vpc_id       = {aws-vpc-id}
  subnet_ids   = {aws-subnet-ids}
}

Requirements

Name Version
terraform >= 1.3.0
aws ~> 4.67

Providers

No providers.

Modules

Name Source Version
alarms ./modules/alarms/ n/a
redis cloudposse/elasticache-redis/aws 0.51.0

Resources

No resources.

Inputs

Name Description Type Default Required
alarms Monitor cluster redis nodes and send alarm to specified topic if memory/cpu/connecions crosses
object({
enabled = optional(bool, true)
topic = string
custom_values = optional(any, {})
})
n/a yes
allowed_security_group_ids The security groups which allowed-to/opened access redis cluster list(string) [] no
apply_immediately Whether to apply the changes immediately bool true no
associated_security_group_ids Security group ids to associate/use for in case you have them created already and do not want to use new created one by setting create_security_group=false list(string) [] no
at_rest_encryption_enabled Whether to enable encryption at rest bool false no
automatic_failover_enabled Whether to enable failover bool true no
availability_zones The list of availability zones which will be used for creating redis cluster list(string) [] no
cluster_mode_enabled Whether to creation native redis cluster bool false no
cluster_mode_num_node_groups Number of node groups (shards) for this Redis replication group number 0 no
cluster_mode_replicas_per_node_group Number of replica nodes in each node group number 0 no
cluster_size Number of nodes in cluster string 2 no
create_security_group Whether to create new security group. If false, associated_security_group_ids must be provided. bool true no
elasticache_subnet_group_name Subnet group name to use for Redis cluster, to not generate new one string "" no
engine_version The version of redis engine string "6.2" no
family The family of the ElastiCache parameter group string "redis6.x" no
final_snapshot_identifier 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
instance_type The nodes instance type in cluster string "cache.t2.micro" no
log_delivery_configuration Allows configure Redis SLOWLOG or Redis Engine Log to CloudWatch Logs or Kinesis Data Firehose. Max of 2 blocks. list(map(any)) [] no
name The name of redis cluster string n/a yes
parameters A list of ElastiCache parameters to apply
list(object({
name = string
value = string
}))
[] no
snapshot_arns 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_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 null no
snapshot_retention_limit The number of days for which ElastiCache will retain automatic cache cluster snapshots before deleting them. number 0 no
snapshot_window The daily time range (in UTC) during which ElastiCache will begin taking a daily snapshot of your cache cluster. string "06:30-07:30" no
subnet_ids The list of subnet ids which will be used for creating redis cluster list(string) [] no
transit_encryption_enabled Whether to enable encryption in transit bool false no
vpc_id The vpc where redis cluster will be created string n/a yes

Outputs

Name Description
arn Elasticache Replication Group ARN
cluster_enabled Indicates if cluster mode is enabled
endpoint Redis primary or configuration endpoint, whichever is appropriate for the given cluster mode
engine_version_actual The running version of the cache engine
host Redis hostname
id Redis cluster ID
member_clusters Redis cluster members
port Redis port
reader_endpoint_address The address of the endpoint for the reader node in the replication group, if the cluster mode is disabled.
security_group_id The ID of the created security group
security_group_name The name of the created security group