Skip to content

Commit

Permalink
LB lookup and set in outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgin314 committed Oct 16, 2024
1 parent 078769d commit 2af72c8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions aws_data.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
data "kubernetes_service" "istio_ingressgateway" {
depends_on = [helm_release.ingress]
metadata {
name = "istio-ingressgateway"
namespace = var.namespace
}
}

data "aws_lb" "lb" {
depends_on = [helm_release.ingress]
name = split("-", data.kubernetes_service.istio_ingressgateway.status[0].load_balancer[0].ingress[0].hostname)[0]
}
6 changes: 3 additions & 3 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ output "module_version" {
value = local.module_version
}

output "istio_namespace" {
description = "The namespace used by istio."
value = kubernetes_namespace.ns.metadata[0].name
output "istio_ingress_lb" {
description = "The istio ingress load balancer DNS."
value = data.aws_lb.lb.dns_name
}

0 comments on commit 2af72c8

Please sign in to comment.