From c9040c3f8343e8c24b46525bd248855d5303e9f3 Mon Sep 17 00:00:00 2001 From: Justin Franco Date: Tue, 17 Sep 2024 13:34:55 -0600 Subject: [PATCH] Allow config endpoint as reader endpoint output (#245) Required when running in cluster mode as there is no reader endpoint Co-authored-by: Kevin --- main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index b4c9e1f..23c15c9 100644 --- a/main.tf +++ b/main.tf @@ -115,8 +115,8 @@ locals { reader_endpoint_serverless = try(aws_elasticache_serverless_cache.default[0].reader_endpoint[0].address, null) reader_endpoint_cluster = try(aws_elasticache_replication_group.default[0].reader_endpoint_address, null) reader_endpoint_instance = try(aws_elasticache_replication_group.default[0].reader_endpoint_address, null) - # Use the serverless reader endpoint if serverless mode is enabled, otherwise use the cluster reader endpoint, otherwise use the instance reader endpoint - reader_endpoint_address = coalesce(local.reader_endpoint_serverless, local.reader_endpoint_cluster, local.reader_endpoint_instance) + # Use the serverless reader endpoint if serverless mode is enabled, otherwise use the cluster reader endpoint, otherwise use the instance reader endpoint, otherwise use the endpoint address + reader_endpoint_address = coalesce(local.reader_endpoint_serverless, local.reader_endpoint_cluster, local.reader_endpoint_instance, local.endpoint_address) } resource "aws_elasticache_subnet_group" "default" {