Dynamic config at project level

I’m trying to get a dynamic config technique working at the project level. This works at the app level, but I have multiple apps that share some configuration and wanted to push it up to the project level.

First Attempt Using Variables

project = "demo_project"
config {
  env = {
    ENV = var.env
    PG_HOST = configdynamic("vault", {
      path = "kv/data/my-app/${var.env}",
      key = "data/PG_HOST"
    })
  }
}

When I try this at the project level, I get the following error:

2022-01-05T14:37:47-06:00: [ERROR] entrypoint.config.watcher.watchloop: error evaluating expression: var=PG_HOST error="PG_HOST:1,60-63: Variables not allowed; Variables may not be used here."

Second Attempt Using Labels

project = "demo_project"
config {
  label "env == dev" {
    env = {
      ENV = "dev"
    }
  }

  env = {
    ENV = "none"
    PG_HOST = configdynamic("vault", {
      path = "kv/data/my-app/${config.env.ENV}",
      key = "data/PG_HOST"
    })
  }
}

I get this error:

2022-01-05T14:53:10-06:00: [WARN]  entrypoint.config.watcher.watchloop: error retrieving config value: source=vault key=PG_HOST err="rpc error: code = Aborted desc = path "kv/data/report-builder/none" is missing"

Any ideas? Is what I’m trying to do possible?

This will be available in 0.7!