Problem starting the distillery envs

Iam having problems for my application to get some envs so I can use Conduit.

config :producer, ProducerQueue.Broker,
  adapter: ConduitSQS,
  access_key_id: "${AWS_ACCESS_KEY_ID}",
  secret_access_key: "${AWS_SECRET_ACCESS_KEY}",
  region: "${AWS_SECRET_ACCESS_KEY}"

Not load envs, if I start the container the variables are inside it.

:wave:

Are you sure Conduit supports this approach for setting config values? Since these values are just strings for elixir, they are not going to be automatically replaced with env var values unless the library author implements such a feature.

According to the docs, this is the approach that they suggest:

config :my_app, MyApp.Broker,
  adapter: ConduitSQS,
  access_key_id: [{:system, "AWS_ACCESS_KEY_ID"}, :instance_role],
  secret_access_key: [{:system, "AWS_SECRET_ACCESS_KEY"}, :instance_role]
1 Like

Yes supports

Seems like it’s using ex_aws underneath, but I can’t find any info on ex_aws supporting this way of setting config values from env vars either.

1 Like

If he uses releases, then that format is supported by distillery. @jackbpaiva are you using releases?

1 Like

But only if REPLACE_OS_VARS is set, iirc.

1 Like

Sure, but the point is that it’s a perfectly fine pattern. It would be better now with 1.9 Config to do just System.get_env calls but only if the project is setup with the new config, and many projects are not yet there.

1 Like

I’m using 1.9 and REPLACE_OS_VARS.