environment variables #1174
-
What's the correct way to read values from environment variables and construct a DSN at runtime for a sql_insert output processor? Or must some external bootstrapper-like program create the benthos config.yaml with these values before benthos can be started? IOW, I am wondering if this can be done from inside the config yaml itself. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think GitHub must've skipped some notification emails... If we're slow to reply here, please reach out via the other means. Regarding your question, please look at https://www.benthos.dev/docs/configuration/interpolation/. If you configure |
Beta Was this translation helpful? Give feedback.
I think GitHub must've skipped some notification emails... If we're slow to reply here, please reach out via the other means.
Regarding your question, please look at https://www.benthos.dev/docs/configuration/interpolation/. If you configure
dsn: ${FOO}
, then Benthos will attempt to set thedsn
to the contents of theFOO
environment variable. You can even specify a default value like so:dsn: ${FOO:foouser:foopassword@tcp(localhost:3306)/foodb}
if you don't want to get an empty string whenFOO
isn't set.