Overriding configuration with environment variables in typesafe config

David Rabinowitz picture David Rabinowitz · Jul 5, 2016 · Viewed 10.6k times · Source

Using typesafe config, how do I override the reference configuration with an environment variable? For example, lets say I have the following configuration:

foo: "bar"

I want it to be overriden with the environment variable FOO if one exists.

Answer

Marco C picture Marco C · Jul 5, 2016

If I correctly understood your question, the answer is here. You can do

foo: "bar"
foo: ${?FOO}