terraform-provider-digitalocean
terraform-provider-digitalocean copied to clipboard
Output test_url to easily click and check that the example has worked
- If IP address is not available yet, "[PENDING]" is shown, resolves #692
We managed to achieve this in a much cleaner way:
resource "helm_release" "ingress" {
name = "ingress"
repository = "https://kubernetes.github.io/ingress-nginx"
chart = "ingress-nginx"
namespace = "ingress-nginx"
create_namespace = true
set {
name = "service.annotations.service\\.beta\\.kubernetes\\.io/do-loadbalancer-name"
value = var.cluster_name
}
}
# ---------------------------------------------------------------------------------------------------------------------
# Retrieve the LB at DO
# ---------------------------------------------------------------------------------------------------------------------
data "digitalocean_loadbalancer" "lb" {
depends_on = [helm_release.ingress]
name = var.cluster_name
}
In the case of this code, you can simply create the following output:
output "test_url" {
value = data.digitalocean_loadbalancer.lb.ip
}