From 37419876d2b686b83d20aa61092699f29b34e5f6 Mon Sep 17 00:00:00 2001 From: Andrei Ilas Date: Wed, 18 Dec 2024 14:13:37 +0200 Subject: [PATCH] fix #972 extension module fails when there is no cluster configured --- module-extensions.tf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module-extensions.tf b/module-extensions.tf index 6e668538..afb7f30f 100644 --- a/module-extensions.tf +++ b/module-extensions.tf @@ -4,7 +4,10 @@ locals { cluster_private_endpoint = ( var.create_cluster ? coalesce(split(":", lookup(one(module.cluster[*].endpoints), "private_endpoint", ""))...) : - coalesce(split(":", lookup(local.existing_cluster_endpoints, "private_endpoint", ""))...) + ( length(local.existing_cluster_endpoints) > 0 ? + coalesce(split(":", lookup(local.existing_cluster_endpoints, "private_endpoint", ""))...): + null + ) ) }