Fix indexing empty array
This commit is contained in:
parent
f5b4a7d323
commit
3443833de1
@ -1,4 +1,4 @@
|
|||||||
output "lb-address" {
|
output "lb-address" {
|
||||||
description = "load balancer hosntame"
|
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] : ""
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user