From 368c9386decd32fe6c8f4be59994eb211fe6ec60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ercan=2Epy=20=E2=98=81=EF=B8=8F?= <18646235+flightlesstux@users.noreply.github.com> Date: Wed, 8 May 2024 16:29:15 +0300 Subject: [PATCH] fix: elasticache_subnet_group creation #78 (#79) Co-authored-by: Veronika Gnilitska <30597968+gberenice@users.noreply.github.com> --- 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" {