<p>I am trying to deploy ArgoCD and applications located in subfolders through Terraform in an AKS cluster.</p>
<p>This is my Folder structure tree:</p>
<p><em>I'm using app of apps approach, so first I will deploy ArgoCD (this will manage itself as well) and later ArgoCD will let me SYNC the cluster-addons and application manually once installed.</em></p>
<pre><code>apps
   cluster-addons
      AKV2K8S
      Cert-Manager
      Ingress-nginx
   application
      application-A
argocd
   override-values.yaml
   Chart
</code></pre>
<p>When I run the command &quot;helm install ...&quot; manually in the AKS cluster everything is installed fine.
ArgoCD is installed and later when I access ArgoCD I see that rest of applications are missing and I can sync them manually.</p>
<p><strong>However, If I want to install it through Terraform only ArgoCD is installed but looks like it does not &quot;detect&quot; the override_values.yaml file</strong>:</p>
<p>i mean, ArgoCD and ArgoCD application set controller are installed in the cluster but ArgoCD does not &quot;detect&quot; the values.yaml files that are customized for my AKS cluster. If I run &quot;helm install&quot; manually on the cluster everything works but not through Terraform</p>
<pre><code>resource &quot;helm_release&quot; &quot;argocd_applicationset&quot; {
  name       = &quot;argocd-applicationset&quot;
  repository = https://argoproj.github.io/argo-helm
  chart      = &quot;argocd-applicationset&quot;
  namespace  = &quot;argocd&quot;
  version    = &quot;1.11.0&quot;
}

resource &quot;helm_release&quot; &quot;argocd&quot; {
  name       = &quot;argocd&quot;
  repository = https://argoproj.github.io/argo-helm
  chart      = &quot;argo-cd&quot;
  namespace  = &quot;argocd&quot;
  version    = &quot;3.33.6&quot;
  values = [
    &quot;${file(&quot;values.yaml&quot;)}&quot;
  ]
</code></pre>
<p>values.yaml file is located in the folder where I have the TF code to install argocd and argocd applicationset.</p>
<p>I tried to change the name of the file&quot; values.yaml&quot; to &quot;override_values.yaml&quot; but same issue.</p>
<p><strong>I have many things changed into the override_values.yaml file so I cannot use &quot;set&quot; inside the TF code...</strong></p>
<p>Also, I tried adding:</p>
<pre><code> values = [
    &quot;${yamlencode(file(&quot;values.yaml&quot;))}&quot;
  ]
</code></pre>
<p>but I get this error in &quot;apply&quot; step in the pipeline:</p>
<pre><code>error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type map[string]interface {} &quot;argo-cd:\r\n  ## ArgoCD configuration\r\n  ## Ref: https://github.com/argoproj/argo-cd\r\n
</code></pre>
<p>Probably because is not a JSON file? It does make sense to convert this file into a JSON one?</p>
<p>Any idea if I can pass this override values yaml file through terraform?</p>
<p>If not, please may you post a clear/full example with mock variables on how to do that using Azure pipeline?</p>
<p>Thanks in advance!</p>

X T
<p>The issue was with the values identation in TF code.</p>
<p>The issue was resolved when I resolve that:</p>
<pre><code>resource &quot;helm_release&quot; &quot;argocd_applicationset&quot; {
  name       = &quot;argocd-applicationset&quot;
  repository = https://argoproj.github.io/argo-helm
  chart      = &quot;argocd-applicationset&quot;
  namespace  = &quot;argocd&quot;
  version    = &quot;1.11.0&quot;
}

resource &quot;helm_release&quot; &quot;argocd&quot; {
  name       = &quot;argocd&quot;
  repository = https://argoproj.github.io/argo-helm
  chart      = &quot;argo-cd&quot;
  namespace  = &quot;argocd&quot;
  version    = &quot;3.33.6&quot;
  values = [file(&quot;values.yaml&quot;)]
</code></pre>
<p>It is working fine also with quoting.</p>
