<p>I'm working on a terraform module to create a GKE cluster. The same module invokes a provisioner that performs a <code>helm install</code> of an application. </p>

<p>The helm chart creates load balancer. The load balancer is not know to the terraform module so that the assigned IP address can't be reused in the module.</p>

<p><strong>Question:</strong></p>

<p>How can I use the IP of the load balancer to create DNS entries and get certificates?</p>

<p>I think this is no exotic use case but I haven't yet found a decent way to achieve this.</p>

<p>The correct answer to this question is:</p>

<p>The data source of the <a href="https://www.terraform.io/docs/providers/kubernetes/d/service.html" rel="noreferrer">kubernetes_service</a>.</p>

<p>The concept of <a href="https://www.terraform.io/docs/configuration/data-sources.html" rel="noreferrer">Data Source</a> is exactly solving the issue here. </p>

<p>Appart from the above kubernetes_service data source I could have also ran a shell script with kubectl querying the ip and use <a href="https://www.terraform.io/docs/providers/external/data_source.html" rel="noreferrer">External Data Source</a> as a generic solution. </p>

<p>From there I can use the IP address in a dns provider and in an acme provider to create dns entries and certificates.</p>
