<p>I am trying to get ingress EXTERNAL-IP in k8s. Is there any way to get the details from terraform data block. like using data &quot;azurerm_kubernetes_cluster&quot; or something?</p>

<p>you can create the Public IP in advance with terraform and assign this IP to your ingress service:</p>
<p>YAML:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  annotations:
    service.beta.kubernetes.io/azure-load-balancer-resource-group: myResourceGroup # only needed if the LB is in another RG
  name: ingress-nginx-controller
spec:
  loadBalancerIP: &lt;YOUR_STATIC_IP&gt;
  type: LoadBalancer
</code></pre>
<p>Same but Terraform code:</p>
<pre><code>resource &quot;kubernetes_service&quot; &quot;ingress_nginx&quot; {
  metadata {
    name = &quot;ingress-nginx-controller&quot;
    
    annotations {
      &quot;service.beta.kubernetes.io/azure-load-balancer-resource-group&quot; = &quot;${azurerm_resource_group.YOUR_RG.name}&quot;
    }

  spec {
    selector = {
      app = &lt;PLACEHOLDER&gt;
    }
    port {
      port        = &lt;PLACEHOLDER&gt;
      target_port = &lt;PLACEHOLDER&gt;
    }

    type = &quot;LoadBalancer&quot;
    load_balancer_ip = &quot;${azurerm_public_ip.YOUR_IP.ip_address}&quot;
  }
}
</code></pre>
