Hey folks!
TL;DR: Elixir oriented AWS library
- Easy configuration.
- Minimal dependencies. Choose your favorite JSON / XML codec and HTTP client.
- Elixir streams to automatically retrieve paginated resources.
- Elixir protocols allow easy customization of Dynamo encoding / decoding.
- Binaries and Maps vs char lists and proplists (I'm looking at you erlcloud)
- Productive defaults. Just install and get coding.
Details:
At my company we use both elixir and AWS services heavily, and so naturally started using erlcloud to manage that interaction. In time however erlcloud came to be problematic, and so we developed ExAws. Over the last couple weeks I've been working to generalize the library to be more community friendly, and I'd love some feedback.
The idea is to provide a clear and consistent elixir integration with AWS APIs, not abstract them away entirely. Clear: Every action for a service (S3, Dynamo, etc) has a correspondingly named and parameterized elixir function. Consistent: optional parameters for an action are just specified as %{option_1: val1, option_2: val2} and you needn't worry about whether option_1 is a header and option 2 is a URL param. There are some higher level abstracts like the aforementioned streams, but those are additive on top of more basic requests.
At the core of this library is the idea of a client, which lets you specify a particular configuration (region, json codec, etc). All calls on that client are guaranteed to use that configuration. You can also have more than one client for a given service, should you have a need to manage resources in multiple regions for example, or have unique configurations per OTP app. This is basically the same architecture used by Ecto Repos.
This solves one of the biggest issues we had with erlcloud. In addition to being just generally a pain to configure since it doesn't work with mix config and uses records, all erlcloud API calls take the configuration as an optional last parameter. If you don't include it, it will silently revert to the default. This can potentially lead to pretty catastrophic unintended behaviour (you meant to delete a table in one region, but forgot to include the config, so it gets deleted in a different region).
There's a variety of other features, but I think it'd be easier to just hit the readme and the documentation found:
We would love to support more AWS APIs, and will add them as I have time and / or as they are used in our products. Suggestions about how to make it easier for others to contribute are more than welcome. The approach taken for adding a service is covered in CONTRIBUTING.md
I should note that this is a PRE-ANN, in that the S3 API is partially incomplete at the moment, and there's some usability improvements I want to do surrounding some of the more complex Dynamo queries (conditional queries). This will be resolved soon, but it seemed to be a good time for some feedback.