<p>I want to set the following annotation using Terraform</p>
<pre><code>nginx.ingress.kubernetes.io/server-snippet: |-
  location ~* /admin {
    allow xxx.xxx.xxx.xxx;
    deny all;
}
</code></pre>
<p>I can set the annotation as long as it is a string like mentioned below</p>
<pre><code>resource &quot;helm_release&quot; &quot;keycloak&quot; {
  repository = &quot;https://charts.bitnami.com/bitnami&quot;
  chart      = &quot;keycloak&quot;
  namespace  = kubernetes_namespace.keycloak.metadata[0].name
  name       = &quot;keycloak&quot;

  set {
    name  = &quot;replicaCount&quot;
    value = 1
  }
}
</code></pre>
<p>but I don't see any reference for <strong>&quot;nginx.ingress.kubernetes.io/server-snippet:&quot;</strong></p>
<pre><code>nginx.ingress.kubernetes.io/server-snippet: |-
  location ~* /admin {
    allow xxx.xxx.xxx.xxx;
    deny all;
}
</code></pre>

One Developer
<p>What about to use yamlencode? Here is just an example:</p>
<pre><code>set {
  name = &quot;server\\.resources&quot;
  value = yamlencode({
    limits = {
      cpu    = &quot;200m&quot;
      memory = &quot;50Mi&quot;
    }
    requests = {
      cpu    = &quot;100m&quot;
      memory = &quot;30Mi&quot;
    }
  })
}
</code></pre>
