Giter Club home page Giter Club logo

awsm's Introduction

CircleCI

awsm - OCaml AWS client

Pure OCaml client for AWS. Code is auto-generated for all services based on the API declared in botocore. Higher level functions are often implemented on top of this base, e.g. to support multi-part uploads to S3. Sub-libraries are provided for blocking, Async, and Lwt versions of all code.

Table of Contents

Features

Services unix package async package lwt package
Amazon Athena (doc) No Yes No
Amazon Cognito (doc) No Yes No
Amazon EC2 (doc) No Yes No
Amazon ECR (doc) No Yes No
Amazon Glue (doc) No Yes No
Amazon IAM (doc) No Yes No
Amazon S3 (doc) No Yes No
Amazon SQS (doc) No Yes No
Cognito SRP No Yes No
Amazon STS (doc) No Yes No

Getting started

Install and build with local OPAM switch and lock file

Run the following commands to install a local OPAM switch based on OCaml 4.11.2 and install all package dependencies via OPAM. (Note that after running make we must also configure the local OPAM environment.)

make install-deps
eval $(opam env)

To actually build the project you are advised to lift system restrictions on stack size, because otherwise some files will fail to build due to stack overflows. On a modern Linux system you can wrap the invocation of make under prlimit:

prlimit --stack=unlimited make

Examples

Here is a short example where we use the S3 API to list the objects of the provided bucket (see amazon API).

open Awsm_async
open! Import
open IO
module S3 = Awsm_s3.Make (IO) (Http)

let pr = Caml.print_endline

let suite_main bucket () =
  Cfg.get () >>= fun cfg ->
  S3.listBuckets cfg >>= fun _ ->
  S3.listObjects cfg (S3.ListObjectsRequest.make ~bucket ()) >>= function
  | #S3.listObjects_error -> failwith "list objects error"
  | `Ok response ->
     Option.iter response.S3.ListObjectsOutput.name ~f:pr ;
     let contents =
       Option.value ~default:[] response.S3.ListObjectsOutput.contents
     in
     let on_object oo = Option.iter (oo.S3.Object.key :> string option) ~f:pr in
     List.iter contents ~f:on_object ;
     return ()

let suite_command =
  Command.async_spec ~summary:"Test script"
    Command.Spec.(empty +> anon ("bucket" %: string))
    suite_main

let () =
  Command.group ~summary:"Awsm test app" [("test-suite", suite_command)]
  |> Command.run

More examples are available in the app directory.

Documentation

The documentation is available on https://opensource.solvuu.com/docs/awsm/api

To generate the awsm API documentation locally you need odoc: opam install odoc.

Then run make doc.

License

Awsm is released under the MIT license.

How to contribute

See CONTRIBUTING for how to help out.

awsm's People

Contributors

rdavison avatar tmcgilchrist avatar

Stargazers

Carmelo Piccione avatar Puneeth Chaganti avatar SelasieHanson avatar Jared Gore avatar  avatar Thomas Gazagnaire avatar Davi William Moraes Suga avatar KC Sivaramakrishnan avatar David Sancho avatar Chris Armstrong avatar Joseph Price avatar Seb Mondet avatar Patrick Ferris avatar Andrejs Agejevs avatar Sora Morimoto avatar Anurag Soni avatar Mika Illouz avatar

Watchers

Ashish Agarwal avatar  avatar Carmelo Piccione avatar

Forkers

tmcgilchrist

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.