How do I pass a nested list to the helm_release resource?

36 views Asked by At

I need this config:

ingress:
  hosts:
    - host: test.example.io
      paths: [/path]

I attempted this and got an error:

  set_list {
    name  = "ingress.hosts"
    value = ["{host: *, paths [/*]}"]
  }

Error: failed parsing key "ingress.hosts" with value {host: *, paths [/*]}, key "}" has no value
1

There are 1 answers

0
Matthew Schuchard On

In this situation you would need to double escape (because Go DSL) any characters that would be interpreted/resolved by HCL2. Specifically the [] is a list type constructor, and the {} is a map type constructor.

set_list {
  name  = "ingress.hosts"
  value = ["\\{host: *, paths \\[/*\\]\\}"]
}