pulumi / esc

Pulumi ESC (Environments, Secrets, and Configuration) for cloud applications and infrastructure.
https://www.pulumi.com/product/esc/
Apache License 2.0
195 stars 4 forks source link

Add a dotenv function to format configuration for environment files #297

Open lblackstone opened 1 month ago

lblackstone commented 1 month ago

Hello!

Issue details

From @pgavlin:

It'd be nice if there was a function like fn::dotenv that took an object and returned a dotenv-formatted string

We can write the following today:

values:
  files:
    DOCKER_ENVFILE: |
      FOO=bar

This would be more flexible as structured configuration along these lines, which would generate an equivalent environment:

values:
  dockerEnv:
    FOO: bar
  files:
    DOCKER_ENVFILE: { fn::dotenv: "${dockerEnv}" }

Affected area/feature