diff --git a/k8s/output.tf b/k8s/output.tf index 02beaf9..f5d23c6 100644 --- a/k8s/output.tf +++ b/k8s/output.tf @@ -1,4 +1,4 @@ output "lb-address" { description = "load balancer hosntame" - value = flatten(kubernetes_service.testaroo-lb[0].status[*].load_balancer[*].ingress[*].hostname)[0] + value = length(kubernetes_service.testaroo-lb[*].status[*].load_balancer[*].ingress[*].hostname) > 0 ? flatten(kubernetes_service.testaroo-lb[*].status[*].load_balancer[*].ingress[*].hostname)[0] : "" }