From 057a375b36ab4d21b3494329562003f4ba615780 Mon Sep 17 00:00:00 2001 From: Ercan Date: Tue, 7 May 2024 23:44:47 +0300 Subject: [PATCH] fix: elasticache_subnet_group creation #78 --- main.tf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.tf b/main.tf index bc9efc1..f45c60b 100644 --- a/main.tf +++ b/main.tf @@ -82,9 +82,11 @@ module "aws_security_group" { # ElastiCache Resources # resource "aws_elasticache_subnet_group" "default" { - count = local.enabled ? 1 : 0 - name = module.this.id - subnet_ids = var.subnets + count = local.enabled && var.elasticache_subnet_group_name == "" && length(var.subnets) > 0 ? 1 : 0 + name = module.this.id + description = "Elasticache subnet group for ${module.this.id}" + subnet_ids = var.subnets + tags = module.this.tags } resource "aws_elasticache_parameter_group" "default" {