Set kibanaConfig via Helm in Terraform

I'm using terraform to deploy Kibana using helm:

resource "helm_release" "kibana" {
  name             = "kibana"
  namespace        = "elastic"
  create_namespace = true

  repository = "https://helm.elastic.co"
  chart      = "kibana"

  set {
    name  = "kibanaConfig"
    value = jsonencode({"kibana.yml": { server : { basePath : "/kibana" } }})
    #    value = "kibana.yml: |\nserver.basePath: /kibana"
  }
}

As you can see I'm trying to overwrite kibanaConfig from the Helm chart. However I'm met with no success.
I'd like to set the server.basePath to /kibana but no matter what I put there for a value the Terraform apply fails.

In this particular example the error message is:

Error: failed parsing key "kibanaConfig" with value {"kibana.yml":{"server":{"basePath":"/kibana"}}}, key "}}" has no value

Could you point to a successful example where this is actually set?

For anyone wondering I found a workaround:

resource "helm_release" "kibana" {
  name             = "kibana"
  namespace        = "elastic"
  create_namespace = true

  repository = "https://helm.elastic.co"
  chart      = "kibana"

  values = [
    file("kibana-values.yaml")
  ]
}

And then create a separate file kibana-values.yaml with the following content:

kibanaConfig:
  kibana.yml: |
    server:
      basePath: /kibana

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.