you’re right, i changed my service code and i no longer see the “module not available” message.
i have encountered another problem though, this is my service code today:
bucket_name = Application.get_env(:ex_aws, :bucket)
file = filename.path
file
|> S3.Upload.stream_file()
|> S3.upload(bucket_name, file)
|> ExAws.request!()
my bucket_name returns nil.
when i run Application.get_env(:ex_aws, :bucket)
on iex -S mix
, it returns nil but it works with Application.get_env(:ex_aws, :access_key_id)
and Application.get_env(:ex_aws, :secret_access_key)
.
iex(21)> Application.get_env(:ex_aws, :access_key_id)
"AKIXXXXXXXXXXXXXXXXXX"
iex(22)> Application.get_env(:ex_aws, :secret_access_key)
"5KXXXXXXXXXXXXXXXXXXX"
iex(23)> Application.get_env(:ex_aws, :bucket)
nil
config :ex_aws,
json_codec: Jason,
access_key_id: "AWS_ACCESS_KEY",
secret_access_key: "AWS_SECRET_ACCESS_KEY",
bucket: "s3-elixir-test",
s3: [
scheme: "https://",
region: "sa-east-1",
host: "s3-sa-east-1.amazonaws.com"
]
ExAws.S3.list_buckets() |> ExAws.request!()
shows my bucket name.
%{
body: %{
buckets: [
%{creation_date: "2020-04-24T14:09:30.000Z", name: "s3-elixir-test"}
],
is there something that i’m missing?
i don’t know if it has any correlation but my console shows this message [warn] ExAws: Received redirect, did you specify the correct region?
even though my region is correct.
sorry for the amount of information but i’m stuck, i hope it’s understandable.
thank you.