Environment variables in config.hcl for envconsul

I want to use a different secret path for different environments in envconsul

exec {
  command = "whatever"
  splay = "5s"

secret {
  path = "secret/data/data-platform-${env(ENVIRONMENT)}/whatever"
  no_prefix = true
  format = "secret_{{ key }}"

upcase = true 

Obviously ${env(ENVIRONMENT)} doesn’t work

URL: GET https://vault.revolutlabs.com/v1/secret/data/data-platform-$%7Benv%28ENVIRONMENT%29%7D/
Code 403

I tried to use cli, but it’s missing format flag and using -secret overrides all values in config. hcl

export ENVIRONMENT=dev
VAULT_TOKEN=s.y envconsul -config config.hcl -secret secret/data/data-platform-$ENVIRONMENT/whatever

this results in SECRET_DATA_DATA_PLATFORM_DEV_XXX env variables instead for SECRET_XXX

Is there a workaround?

It seems this PR (still open :frowning: ) would help

Other workaround is to have multiple .hcl files.