<p>We are using helm provider in Terraform to provision istio ingress gateway which in backend use this <a href="https://artifacthub.io/packages/helm/istio-official/gateway" rel="nofollow noreferrer">chart</a></p>
<p>Below is the terraform code snippet to provision the same. Please help to override the default chart value to create an internal load balancer instead of the default external one. We are aware that it can be done by updating the annotation in the manifest file. But not sure how to do the same in the terraform code snippet?</p>
<pre><code>terraform {
  required_providers {
    helm = {
      source = &quot;hashicorp/helm&quot;
      version = &quot;&gt;= 1.0.0&quot;
    }
  }
}

provider &quot;helm&quot; {
  kubernetes {
    config_path = &quot;${var.kubeconfig_file}&quot;
  }
}

resource &quot;helm_release&quot; &quot;istio-ingress&quot; {
  repository        = local.istio_charts_url
  chart             = &quot;gateway&quot;
  name              = &quot;istio-ingress-gateway&quot;
  namespace         = kubernetes_namespace.istio_system.metadata.0.name
  version           = &quot;&gt;= 1.12.1&quot;
  timeout           = 500
  cleanup_on_fail   = true
  force_update      = false
  depends_on        = [helm_release.istiod]
}
</code></pre>

Nitin G
<p>You can either use the <code>set</code> argument block (<a href="https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release#set" rel="nofollow noreferrer">https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release#set</a>) or the <code>values</code> argument (<a href="https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release#values" rel="nofollow noreferrer">https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release#values</a>) of the resource <code>helm_release</code> to override the default settings from the original <code>values.yaml</code></p>
<p>Should look something like:</p>
<pre><code>resource &quot;helm_release&quot; &quot;istio-ingress&quot; {
  repository        = local.istio_charts_url
  chart             = &quot;gateway&quot;
  name              = &quot;istio-ingress-gateway&quot;
  namespace         = kubernetes_namespace.istio_system.metadata.0.name
  version           = &quot;&gt;= 1.12.1&quot;
  timeout           = 500
  cleanup_on_fail   = true
  force_update      = false
  depends_on        = [helm_release.istiod]

  set {
    name  = &quot;serviceAnnotations.cloud.google.com/load-balancer-type&quot;
    value = &quot;internal&quot;
  }
}
</code></pre>
<p>or</p>
<pre><code>resource &quot;helm_release&quot; &quot;istio-ingress&quot; {
  repository        = local.istio_charts_url
  chart             = &quot;gateway&quot;
  name              = &quot;istio-ingress-gateway&quot;
  namespace         = kubernetes_namespace.istio_system.metadata.0.name
  version           = &quot;&gt;= 1.12.1&quot;
  timeout           = 500
  cleanup_on_fail   = true
  force_update      = false
  depends_on        = [helm_release.istiod]

  values = [
    file(&quot;${path.module}/custom-values.yaml&quot;)
  ]
}
</code></pre>
<p>and place a <code>custom-values.yaml</code> file in your code.</p>
<p>This article explains it pretty nicely:
<a href="https://getbetterdevops.io/terraform-with-helm/" rel="nofollow noreferrer">https://getbetterdevops.io/terraform-with-helm/</a></p>
<p>Hope this helps!</p>
