GithubHelp home page GithubHelp logo

isabella232 / rabbitmq-aws Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rabbitmq/rabbitmq-aws

0.0 0.0 0.0 1.87 MB

AWS client library used by RabbitMQ subprojects. Originally a fork of httpc-aws by Gavin Roy.

License: Other

Makefile 12.27% Erlang 87.73%

rabbitmq-aws's Introduction

rabbitmq-aws

This was migrated to https://github.com/rabbitmq/rabbitmq-server

This repository has been moved to the main unified RabbitMQ "monorepo", including all open issues. You can find the source under /deps/rabbitmq_aws. All issues have been transferred.

Overview

A fork of gmr/httpc-aws for use in building RabbitMQ plugins that interact with Amazon Web Services APIs.

Build Status

Supported Erlang Versions

Same as RabbitMQ

Configuration

Configuration for rabbitmq-aws is can be provided in multiple ways. It is designed to behave similarly to the AWS Command Line Interface with respect to providing region and configuration information. Additionally it has two methods, rabbitmq_aws:set_region/1 and rabbitmq_aws:set_credentials/2 to allow for application specific configuration, bypassing the automatic configuration behavior.

Configuration Precedence

The configuration values have the following precedence:

  • Explicitly configured via API
  • Environment variables
  • Configuration file
  • EC2 Instance Metadata Service where applicable

Credentials Precedence

The credentials values have the following precedence:

  • Explicitly configured via API
  • Environment variables
  • Credentials file
  • EC2 Instance Metadata Service

Environment Variables

As with the AWS CLI, the following environment variables can be used to provide configuration or to impact configuration behavior:

  • AWS_DEFAULT_PROFILE
  • AWS_DEFAULT_REGION
  • AWS_CONFIG_FILE
  • AWS_SHARED_CREDENTIALS_FILE
  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY

API Functions

Method Description
rabbitmq_aws:set_region/1 Manually specify the AWS region to make requests to.
rabbitmq_aws:set_credentials/2 Manually specify the request credentials to use.
rabbitmq_aws:refresh_credentials/0 Refresh the credentials from the environment, filesystem, or EC2 Instance Metadata service.
rabbitmq_aws:get/2 Perform a GET request to the API specifying the service and request path.
rabbitmq_aws:get/3 Perform a GET request specifying the service, path, and headers.
rabbitmq_aws:post/4 Perform a POST request specifying the service, path, headers, and body.
rabbitmq_aws:request/5 Perform a request specifying the service, method, path, headers, and body.
rabbitmq_aws:request/6 Perform a request specifying the service, method, path, headers, body, and httpc:http_options().
rabbitmq_aws:request/7 Perform a request specifying the service, method, path, headers, body, httpc:http_options(), and override the API endpoint.

Example Usage

The following example assumes that you either have locally configured credentials or that you're using the AWS Instance Metadata service for credentials:

application:start(rabbitmq_aws).
{ok, {Headers, Response}} = rabbitmq_aws:get("ec2","/?Action=DescribeTags&Version=2015-10-01").

To configure credentials, invoke rabbitmq_aws:set_credentials/2:

application:start(rabbitmq_aws).

rabbitmq_aws:set_credentials("AKIDEXAMPLE", "wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY"),

RequestHeaders = [{"Content-Type", "application/x-amz-json-1.0"},
                  {"X-Amz-Target", "DynamoDB_20120810.ListTables"}],
                  
{ok, {Headers, Response}} = rabbitmq_aws:post("dynamodb", "/", 
                                              "{\"Limit\": 20}",
                                              RequestHeaders).

Build

make

Test

make tests

License

BSD 3-Clause License

rabbitmq-aws's People

Contributors

acogoluegnes avatar binarin avatar dcorbacho avatar dumbbell avatar gerhard avatar gmr avatar hairyhum avatar kjnilsson avatar lukebakken avatar michaelklishin 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.