Skip to content

Commit 368c938

Browse files
fix: elasticache_subnet_group creation #78 (#79)
Co-authored-by: Veronika Gnilitska <[email protected]>
1 parent 4f41139 commit 368c938

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

main.tf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,11 @@ module "aws_security_group" {
8282
# ElastiCache Resources
8383
#
8484
resource "aws_elasticache_subnet_group" "default" {
85-
count = local.enabled ? 1 : 0
86-
name = module.this.id
87-
subnet_ids = var.subnets
85+
count = local.enabled && var.elasticache_subnet_group_name == "" && length(var.subnets) > 0 ? 1 : 0
86+
name = module.this.id
87+
description = "Elasticache subnet group for ${module.this.id}"
88+
subnet_ids = var.subnets
89+
tags = module.this.tags
8890
}
8991

9092
resource "aws_elasticache_parameter_group" "default" {

0 commit comments

Comments
 (0)