Setting up bamboo emails with SES, getting a credential type error

I am trying to get emails working on my server (PROD setup) and I have this so far:

mix.exs:

{:bamboo, "~> 1.1"},
{:bamboo_ses, "~> 0.1.0"},

config/prod_secret.exs:

config :ex_aws,
  access_key_id: [{:system, "abc123"}, :instance_role],
  secret_access_key: [{:system, "def123"}, :instance_role]  

config :realtime, Realtime.Mailer, adapter: Bamboo.SesAdapter

I’m not sure the above is correct, but that was the example on the main page. I’m not suing env vars to hold the secret values, is this correct?

When I tried sending an email out I see this in my logs:

realtime_1   |             (ex_aws) lib/ex_aws/instance_meta.ex:64: ExAws.InstanceMeta.instance_role_credentials/1
realtime_1   |             (ex_aws) lib/ex_aws/instance_meta.ex:72: ExAws.InstanceMeta.security_credentials/1
realtime_1   |             (ex_aws) lib/ex_aws/config/auth_cache.ex:79: ExAws.Config.AuthCache.refresh_config/2
realtime_1   |             (ex_aws) lib/ex_aws/config/auth_cache.ex:41: ExAws.Config.AuthCache.handle_call/3
realtime_1   |             (stdlib) gen_server.erl:661: :gen_server.try_handle_call/4
realtime_1   |             (stdlib) gen_server.erl:690: :gen_server.handle_msg/6
realtime_1   |             (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
realtime_1   |     (elixir) lib/gen_server.ex:924: GenServer.call/3
realtime_1   |     (ex_aws) lib/ex_aws/config.ex:80: ExAws.Config.retrieve_runtime_value/2
realtime_1   |     (elixir) lib/stream.ex:562: anonymous fn/4 in Stream.map/2
realtime_1   |     (elixir) lib/enum.ex:3281: Enumerable.List.reduce/3
realtime_1   |     (elixir) lib/stream.ex:1553: Enumerable.Stream.do_each/4
realtime_1   |     (elixir) lib/enum.ex:940: Enum.find/3
realtime_1   |     (ex_aws) lib/ex_aws/config.ex:67: anonymous fn/2 in ExAws.Config.retrieve_runtime_config/1
realtime_1   |     (stdlib) maps.erl:257: :maps.fold_1/3
realtime_1   | Function: #Function<0.73693256/0 in Bamboo.TaskSupervisorStrategy.deliver_later/3>

I got it working with:

config :ex_aws,
  access_key_id: ["abc123"],
  secret_access_key: ["def123"]  

config :realtime, Realtime.Mailer, adapter: Bamboo.SesAdapter
2 Likes