defp bucket!, do: System.fetch_env!("BUCKET_NAME")
This will look at that environment variable at build time. For many workflows this doesn't work because you may build the app in CI and run it with different buckets in production and staging.I always default to using Application.get_env/2 and setting the value in runtime.exs, now that that's a thing in recent Elixir.
For things where performance matters in a hot loop, it might be worth compiling in the value, but I wouldn't imagine that's the case here where it's a part of a network call to AWS.