pulumi/esc

Add a way to export a value as both pulumiConfig and environment variable

Opened this issue · 1 comments

99% case for me when using ESC for app development is exporting most/all of my variables as both pulumiConfig and environment variables. It is kind of a pain to have to do the following for every value I add:

  1. Add the KVP
  2. create an entry in pulumiConfig
  3. create an entry in environment variables

Too much copy/paste, repeating myself, and too many opportunities to misspell something. I should just be able to declare a value, and have a simple way to export it to both config and env vars rather than having to repeat myself.

I think @arunkumar611 has brought this up a few times. Any ideas on how we might expose this?

First thought is a top-level settings object:

settings:
  exportToPulumiConfig: true
  exportToEnvironmentVariables: true
values:
  foo: bar
  with-hyphens: haha business

results in

{
  "foo": "bar",
  "with-hyphens": "haha business",
  "pulumiConfig": {
    "foo": "bar",
    "with-hyphens": "haha business"
  },
  "environmentVariables": {
    "FOO": "bar",
    "WITH_HYPHENS": "haha business"
  }
}