GithubHelp home page GithubHelp logo

aws-elixir's Introduction

AWS clients for Elixir

Actions Status

🌳 With this library you can talk to almost all AWS services without hassle. ⚡

Features

  • A clean API separated per service. Each module has a correspondent service.
  • Support for most of AWS services.
  • Configurable HTTP client and JSON parser.
  • Generated by aws-codegen using the same JSON descriptions of AWS services used to build the AWS SDK for Go.
  • Documentation is updated from the official AWS docs.

Usage

Here is an example of listing Amazon Kinesis streams. First you need to start a console with iex -S mix. After that, type the following:

iex> client = AWS.Client.create("your-access-key-id", "your-secret-access-key", "us-east-1")

iex> {:ok, result, resp} = AWS.Kinesis.list_streams(client, %{})

iex> IO.inspect(result)
%{"HasMoreStreams" => false, "StreamNames" => []}

If you are using S3, you can upload a file with integrity check doing:

iex> client = AWS.Client.create("your-access-key-id", "your-secret-access-key", "us-east-1")
iex> file =  File.read!("./tmp/your-file.txt")
iex> md5 = :crypto.hash(:md5, file) |> Base.encode64()

iex> AWS.S3.put_object(client, "your-bucket-name", "foo/your-file-on-s3.txt", %{"Body" => file, "ContentMD5" => md5})

Installation

  • Add aws to your list of dependencies in mix.exs. It also requires hackney for the default HTTP client. Optionally, you can implement your own (Check AWS.Client docs).

    def deps do
      [
        {:aws, "~> 0.7.0"},
        {:hackney, "~> 1.17"}
      ]
    end
  • Run mix deps.get to install.

Development

Most of the code is generated using the aws-codegen library from the JSON descriptions of AWS services provided by Amazon. They can be found in lib/aws/generated.

Code outside lib/aws/generated is manually written and used as support for the generated code.

Documentation

Online

Local

  • Run MIX_ENV=docs mix docs
  • Open docs/index.html

note: Arguments, errors and reponse structure can be found by viewing the model schemas used to generate this module at aws-sdk-go/models/apis/<aws-service>/<version>/. An example is aws-sdk-go/models/apis/rekognition/2016-06-27/api-2.json. Alternatively you can access the documentation for the service you want at AWS docs page.

Tests

mix test

Release

  • Make sure the CHANGELOG.md is up-to-date and and reflects the changes for the new version.
  • Bump the version here in the README.md and in mix.exs.
  • Run git tag v$VERSION to tag the version that was just published.
  • Run git push --tags origin master to push tags to Github.
  • Run mix hex.publish to publish the new version.

License

© 2015-2017 Jamshed Kakar [email protected]. See LICENSE file for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.