Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ output "port" {
}

output "endpoint" {
value = aws_elasticache_replication_group.redis.primary_endpoint_address
value = var.cluster_mode_enabled ? join("", compact(aws_elasticache_replication_group.redis[*].configuration_endpoint_address)) : join("", compact(aws_elasticache_replication_group.redis[*].primary_endpoint_address))
description = "Redis primary or configuration endpoint, whichever is appropriate for the given cluster mode"
}

15 changes: 12 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ variable "vpc_id" {
}

variable "redis_parameters" {
type = list(string)
description = "additional parameters modifyed in parameter group"
default = []
description = "additional parameters modified in parameter group"
type = list(object({
name = string
value= string
}))
default = []
}

variable "redis_maintenance_window" {
Expand All @@ -101,4 +104,10 @@ variable "availability_zones" {
description = "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"
type = list(string)
default = []
}

variable "cluster_mode_enabled" {
type = bool
description = "Flag to enable/disable creation of a native redis cluster. `automatic_failover_enabled` must be set to `true`. Only 1 `cluster_mode` block is allowed"
default = false
}