Skip to content

Commit

Permalink
Put config in standard location
Browse files Browse the repository at this point in the history
  • Loading branch information
reachfh committed Feb 9, 2024
1 parent 4f92ea4 commit c7a1770
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ if config_env() == :prod do
#
# See https://hexdocs.pm/swoosh/Swoosh.html#module-installation for details.


# Only configure the production mailer if we have AWS credentials
if System.get_env("AWS_ACCESS_KEY_ID") || System.get_env("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI") do
config :absinthe_federation_example, AbsintheFederationExample.Mailer, adapter: Swoosh.Adapters.ExAwsAmazonSES
config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: AbsintheFederationExample.Finch
# Disable Swoosh Local Memory Storage
config :swoosh, local: false
end

config :libcluster, debug: true

# https://dmblake.com/elixir-clustering-with-libcluster-and-aws-ecs-fargate-in-cdk
Expand Down Expand Up @@ -179,12 +188,4 @@ if config_env() == :prod do
access_key_id: [{:system, "AWS_ACCESS_KEY_ID"}, :instance_role],
secret_access_key: [{:system, "AWS_SECRET_ACCESS_KEY"}, :instance_role],
region: System.get_env("AWS_REGION") || "us-east-1"

# Only configure the production mailer if we have AWS credentials
if System.get_env("AWS_ACCESS_KEY_ID") || System.get_env("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI") do
config :absinthe_federation_example, AbsintheFederationExample.Mailer, adapter: Swoosh.Adapters.ExAwsAmazonSES
config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: AbsintheFederationExample.Finch
# Disable Swoosh Local Memory Storage
config :swoosh, local: false
end
end

0 comments on commit c7a1770

Please sign in to comment.