[Pre-ANN] ExAws: Elixir oriented clients for AWS services.

264 views
Skip to first unread message

Ben Wilson

unread,
May 4, 2015, 10:37:51 AM5/4/15
to elixir-l...@googlegroups.com
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.

Jason Stiebs

unread,
May 4, 2015, 11:13:44 AM5/4/15
to elixir-l...@googlegroups.com
Very nice work Ben! This is a tremendous effort.

--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/1fbaf950-b103-4d53-bb2f-b06e387d627d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ben Wilson

unread,
May 4, 2015, 11:19:37 AM5/4/15
to elixir-l...@googlegroups.com
Thanks!

I should add that one thing in particular I would really appreciate some feedback on is the use of Maps vs Keyword lists for options to arguments. Right now I'm using maps, but I'm open to switching Keyword lists (although they'd be converted to maps almost immediately).

Ben Wilson

unread,
May 8, 2015, 12:00:49 PM5/8/15
to elixir-l...@googlegroups.com
After some very helpful feedback from a variety of people I've standardized options in Dynamo / Kinesis / Lambda APIs, and tediously documented them all via typespec! IE: http://hexdocs.pm/ex_aws/ExAws.Dynamo.Client.html

ExAws 0.0.5 is out, and those three APIs should be regarded as pretty stable. S3 remains unfinished, but the big ones like put_object and such work. Happy coding!
Reply all
Reply to author
Forward
0 new messages