Code Monkey home page Code Monkey logo

erlcloud's Introduction

erlcloud: Cloud Computing APIs For Erlang

This is version 0.8.0. The API is subject to change.

Service APIs implemented:

  • Amazon Elastic Compute Cloud (EC2)
  • Amazon Simple Storage Service (S3)
  • Amazon Simple Queue Service (SQS)
  • Amazon SimpleDB
  • Amazon Mechanical Turk
  • Amazon CloudWatch (MON)
  • Amazon DynamoDB (ddb2)

All API functions have been implemented. Not all functions have been thoroughly tested, so exercise care when integrating this library into production code. Please send bug reports and patches.

The libraries can be used two ways: either you can specify configuration parameters in the process dictionary, or you can create a configuration object and pass that to each request as the final parameter.

Getting started

You need to clone the repository and download rebar (if it's not already available in your path).

git clone https://github.com/gleber/erlcloud.git
cd erlcloud
wget http://cloud.github.com/downloads/basho/rebar/rebar && chmod u+x rebar

You can provide your amazon credentials in environmental variables.

export AWS_ACCESS_KEY_ID=<Your AWS Access Key>
export AWS_SECRET_ACCESS_KEY=<Your AWS Secret Access Key>

To compile and run erlcloud

make run

If you're using erlcloud in your application, add it as a dependency in your application's configuration file. To use erlcloud in the shell, you can start it by calling:

ssl:start().
erlcloud:start().

If you did not provide your amazon credentials in the environmental variables, then you need to provide the per-process configuration:

erlcloud_ec2:configure(AccessKeyId, SecretAccessKey [, Hostname]).

Hostname defaults to "ec2.amazonaws.com".

Then you can start making api calls, like:

erlcloud_ec2:describe_images().
erlcloud_s3:list_buckets().

Configuration object usage:

EC2 = erlcloud_ec2:new(AccessKeyId, SecretAccessKey [, Hostname])
erlcloud_ec2:describe_images(EC2).

Creating an EC2 instance may look like this:

start_instance(Ami, KeyPair, UserData, Type, Zone) ->
    Config = #aws_config{
            access_key_id = application:get_env(aws_key),
            secret_access_key = application:get_env(aws_secret)
           },

    InstanceSpec = #ec2_instance_spec{image_id = Ami,
                                      key_name = KeyPair,
                                      instance_type = Type,
                                      availability_zone = Zone,
                                      user_data = UserData},
    erlcloud_ec2:run_instances(InstanceSpec, Config).

For usage information, consult the source code and refer to the API reference at:

Roadmap

v0.8.0

  • Existing code

v0.9.0

  • Make unit tests useful and improve documentation

v1.0.0

  • Refactored code for better return values (issue #7)

Notes

Indentation in contributions should follow indentation style of surrounding text. In general it follows default indentation rules of official erlang-mode as provided by OTP team.

erlcloud's People

Contributors

gleber avatar bwbuchanan avatar fogfish avatar nivertech avatar ericbmerritt avatar pnc avatar couchemar avatar joelreymont avatar paulperegud avatar licenser avatar srstrong avatar fabiankrol avatar jlouis avatar tsloughter avatar jgordor avatar clofresh avatar hwatkins avatar irvin avatar

Watchers

Sergio Veiga avatar James Cloos avatar

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.