Embeding variables from values.yaml into vault-agent templates


I’m trying to write a configmap for a sidecar vault-agent. Everything is working as it should theoretically. However some of the data we don’t consider as secrets and we set it up in the values.yaml file. When rendering {{ .Values.someVariable }} we get <no value>. {{ .Data.data }} is rendered correctly so that’s not the issue here. I’ve tried defining variables to no avail. Is there a way to use data from values.yaml into the secret template in config.hcl?


"contents" = <<EOT
        {{- $mssqlMARS := .Values.mssql.multipleActiveResultSets }}
        {{- $mssqlMaxPoolSize := .Values.mssql.mssqlMaxPoolSize }}
        {{ with secret "secrets/mssql" -}}
        "ConnectionString": "Server={{ .Data.data.server }};Database={{ .Data.data.database }};User Id={{ .Data.data.user_id }};Password={{ .Data.data.password }};MultipleActiveResultSets={{ $mssqlMARS }};Max Pool Size={{ $mssqlMaxPoolSize }};",
        {{ end }}