<p>I am running out of ideas of how can I set object type var as helm variable in terraform. I want to set the following variable and pass it to helm chart:</p>
<pre><code>resource &quot;helm_release&quot; &quot;cluster_autoscaler&quot; {
  name       = &quot;cluster-autoscaler&quot;
  chart      = &quot;cluster-autoscaler&quot;
  repository = &quot;https://kubernetes.github.io/autoscaler&quot;
  version    = &quot;9.9.2&quot;

  set {
    name  = &quot;extraArgs&quot;
    value = {balance-similar-node-groups:true,skip-nodes-with-system-pods:false}
  }
</code></pre>
<p>I get an error that value can be string only, but chart expects object type. Anyone smart knows how to solve this?</p>
<p>link to helm chart docs: <a href="https://github.com/kubernetes/autoscaler/tree/master/charts/cluster-autoscaler" rel="nofollow noreferrer">https://github.com/kubernetes/autoscaler/tree/master/charts/cluster-autoscaler</a></p>
<p>Thanks</p>

kirsie
<p>You can use multiple <code>set</code> blocks, as SamRoch08 <a href="https://stackoverflow.com/a/75997646/3289080">indicates</a>, but you don't need to use dynamic blocks to take advantage of that. In fact, it's as simple as:</p>
<pre><code>resource &quot;helm_release&quot; &quot;cluster_autoscaler&quot; {
  name       = &quot;cluster-autoscaler&quot;
  chart      = &quot;cluster-autoscaler&quot;
  repository = &quot;https://kubernetes.github.io/autoscaler&quot;
  version    = &quot;9.9.2&quot;

  set {
    name  = &quot;extraArgs.balance-similar-node-groups&quot;
    value = true
  }
  set {
    name  = &quot;extraArgs.skip-nodes-with-system-pods&quot;
    value = false
  }

  ...
}
</code></pre>
