Skip to content

Commit b1d2acf

Browse files
authored
Merge pull request #7 from VIOOH/SRE-7373
[SRE-7373] Updated code to support dynamic block change
2 parents ff3f01a + 58a101d commit b1d2acf

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ output "port" {
1919
}
2020

2121
output "endpoint" {
22-
value = aws_elasticache_replication_group.redis.primary_endpoint_address
22+
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))
23+
description = "Redis primary or configuration endpoint, whichever is appropriate for the given cluster mode"
2324
}
24-

variables.tf

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,12 @@ variable "vpc_id" {
7272
}
7373

7474
variable "redis_parameters" {
75-
type = list(string)
76-
description = "additional parameters modifyed in parameter group"
77-
default = []
75+
description = "additional parameters modified in parameter group"
76+
type = list(object({
77+
name = string
78+
value= string
79+
}))
80+
default = []
7881
}
7982

8083
variable "redis_maintenance_window" {
@@ -101,4 +104,10 @@ variable "availability_zones" {
101104
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"
102105
type = list(string)
103106
default = []
107+
}
108+
109+
variable "cluster_mode_enabled" {
110+
type = bool
111+
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"
112+
default = false
104113
}

0 commit comments

Comments
 (0)