ExAws v0.2.0
Features:
- Override configuration on a per request basis.
- AWS standard default config. No mix config required at all now. Defaults covered below.
- Use instance roles to pull credentials.
- Enable configuration options such as
{:system, "AWS_SECRET_KEY"}
that pull the specified environment variable at runtime.
v0.2.0 adds the ability to use the IAM role associated with an instance to obtain AWS keys. It will automatically refresh them as they expire. Below is the now default configuration for obtaining AWS keys. Note that it checks the environment first, and then the instance roles.
config :ex_aws,
access_key_id: [{:system, "AWS_ACCESS_KEY_ID"}, :instance_role],
secret_access_key: [{:system, "AWS_SECRET_ACCESS_KEY"}, :instance_role]
v0.2.0 also adds the ability to alter the configuration used on a per request basis. For example, to use AWS keys determined at the time of request do:
{access_key, secret_key} = determine_aws_auth # do whatever you do
ExAws.Dynamo.new(access_key_id: access_key, secret_access_key: secret_key)
|> ExAws.Dynamo.Impl.list_tables
BREAKING CHANGE:
Any clients that override the request function will need to note the changes to the request's arguments. Previously it was request(data, action)
and it is now request(client, action, data)
. The client argument should be passed along to the Request.request function instead of MODULE as it currently is. Here's an example with Lambda: f4eca68#diff-c6a980311c2578661d17a86172da2b7dL193