Skip to content

karopolopoulos/aws-sdk-light

Repository files navigation

AWS SDK Light

npm

This package is primarily focused at enabling Apigee users to integrate with AWS services directly from a JavaScript Policy. However it can certainly be used by anyone.

Although there are already many great libraries that allow integration into AWS services (including the actual aws-sdk!) I found that the situation I was in did not allow me to use them 😭 😡.

Key things about why I made this:

Installation

Available on npm

npm install aws-sdk-light

Overview

Importing

// import entire SDK
var awsSdkLight = require('aws-sdk-light');

// import single module
var awsSdkLight = require('aws-sdk-light/clients/lambda');

Usage

var awsSdkLight = require('aws-sdk-light');

var options = {
  accessKeyId: '<value>',
  secretAccessKey: '<value>',
  region: '<value>'
};
var lambda = new awsSdkLight.Lambda(options);

var params = {
  FunctionName: 'hello-world',
  Payload: <string>
};
lambda.invoke(params, function(err, data) {
  if (err) {
    console.log(err);
  } else {
    console.log(data)
  }
});

Documentation