Skip to content

Commit 0f23a47

Browse files
authored
chore: bump elasticache-redis module version (cloudposse/terraform-aws-components#1040)
1 parent bdb899b commit 0f23a47

File tree

4 files changed

+32
-8
lines changed

4 files changed

+32
-8
lines changed

src/main.tf

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ locals {
3838
vpc_id = module.vpc.outputs.vpc_id
3939
subnets = module.vpc.outputs.private_subnet_ids
4040
availability_zones = var.availability_zones
41+
multi_az_enabled = var.multi_az_enabled
4142

4243
allowed_security_groups = local.allowed_security_groups
4344
additional_security_group_rules = local.additional_security_group_rules
@@ -65,13 +66,15 @@ module "redis_clusters" {
6566
cluster_name = lookup(each.value, "cluster_name", replace(each.key, "_", "-"))
6667
dns_subdomain = join(".", [lookup(each.value, "cluster_name", replace(each.key, "_", "-")), module.this.environment])
6768

68-
instance_type = each.value.instance_type
69-
num_replicas = lookup(each.value, "num_replicas", 1)
70-
num_shards = lookup(each.value, "num_shards", 0)
71-
replicas_per_shard = lookup(each.value, "replicas_per_shard", 0)
72-
engine_version = each.value.engine_version
73-
parameters = each.value.parameters
74-
cluster_attributes = local.cluster_attributes
69+
instance_type = each.value.instance_type
70+
num_replicas = lookup(each.value, "num_replicas", 1)
71+
num_shards = lookup(each.value, "num_shards", 0)
72+
replicas_per_shard = lookup(each.value, "replicas_per_shard", 0)
73+
engine_version = each.value.engine_version
74+
create_parameter_group = lookup(each.value, "create_parameter_group", true)
75+
parameters = lookup(each.value, "parameters", null)
76+
parameter_group_name = lookup(each.value, "parameter_group_name", null)
77+
cluster_attributes = local.cluster_attributes
7578

7679
context = module.this.context
7780
}

src/modules/redis_cluster/main.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ locals {
1010

1111
module "redis" {
1212
source = "cloudposse/elasticache-redis/aws"
13-
version = "0.52.0"
13+
version = "1.2.2"
1414

1515
name = var.cluster_name
1616

@@ -22,6 +22,7 @@ module "redis" {
2222
auth_token = local.auth_token
2323
automatic_failover_enabled = var.cluster_attributes.automatic_failover_enabled
2424
availability_zones = var.cluster_attributes.availability_zones
25+
multi_az_enabled = var.cluster_attributes.multi_az_enabled
2526
cluster_mode_enabled = var.num_shards > 0
2627
cluster_mode_num_node_groups = var.num_shards
2728
cluster_mode_replicas_per_node_group = var.replicas_per_shard
@@ -30,7 +31,9 @@ module "redis" {
3031
engine_version = var.engine_version
3132
family = var.cluster_attributes.family
3233
instance_type = var.instance_type
34+
create_parameter_group = var.create_parameter_group
3335
parameter = var.parameters
36+
parameter_group_name = var.parameter_group_name
3437
port = var.cluster_attributes.port
3538
subnets = var.cluster_attributes.subnets
3639
transit_encryption_enabled = var.cluster_attributes.transit_encryption_enabled

src/modules/redis_cluster/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ variable "cluster_name" {
55
description = "Elasticache Cluster name"
66
}
77

8+
variable "create_parameter_group" {
9+
type = bool
10+
default = true
11+
description = "Whether new parameter group should be created. Set to false if you want to use existing parameter group"
12+
}
13+
814
variable "engine_version" {
915
type = string
1016
description = "Redis Version"
@@ -66,6 +72,12 @@ variable "parameters" {
6672
description = "Parameters to configure cluster parameter group"
6773
}
6874

75+
variable "parameter_group_name" {
76+
type = string
77+
default = null
78+
description = "Override the default parameter group name"
79+
}
80+
6981
variable "kms_alias_name_ssm" {
7082
default = "alias/aws/ssm"
7183
description = "KMS alias name for SSM"

src/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ variable "availability_zones" {
99
default = []
1010
}
1111

12+
variable "multi_az_enabled" {
13+
type = bool
14+
default = false
15+
description = "Multi AZ (Automatic Failover must also be enabled. If Cluster Mode is enabled, Multi AZ is on by default, and this setting is ignored)"
16+
}
17+
1218
variable "family" {
1319
type = string
1420
description = "Redis family"

0 commit comments

Comments
 (0)