Skip to content

Commit

Permalink
Allow config endpoint as reader endpoint output (#245)
Browse files Browse the repository at this point in the history
Required when running in cluster mode as there is no reader endpoint

Co-authored-by: Kevin <belay.00.theorem@icloud.com>
  • Loading branch information
justinfranco and kevcube authored Sep 17, 2024
1 parent 7a31a53 commit c9040c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit c9040c3

Please sign in to comment.