aws-butler
Features
- all methods for all services can be executed using either promises or callbacks - promises use when.js for maximum compatibility
- pageable requests are handled for you - the promise or callback will only be resolved once all pages of data have been retrieved
- an optional transform function can be provided in request parameters - this allows you to get the data you want with ease
- aws-butler doesn't change the interface to the SDK methods nor does it alter the response so your current code will work with this module
NOTE: when requests are 'pageable', an array is returned with each element containing the data from a page. If you provide a transform function, the transform is executed for every page of data before it's added to the resulting array. This enables you to tailor the resulting array to get the data in a suitable format. Check out the transform example to see how this can be used to your advantage.
Usage
var AWS = ; var ec2 = region: "us-east-1" ; // example using promiseec2 ; // example using callbackec2;
Example using a transform function to get the IDs of running instances
var AWS = ; var ec2 = region: "eu-west-1" ; // params defined with optional transform functionvar params = Filters: Name: "instance-state-name" Values: "running" { var ids = ; dataReservations; return ids; }; // example using promiseec2 ; // example using callbackec2;
ES6/ES2015
Initially I wrote this using ES6 native promises, arrow functions etc. Unfortunately, ES6 support is still lacking in many places e.g. AWS Lambda uses Node v0.10.36 so no ES6 there. I tried using babel but it was too unreliable. I decided that for maximum compatibility and so people can use this module without issues I'd avoid ES6, at least for now.
Disclaimer
This module is open source and free to use however AWS is not free. I can't be held responsible for any charges you may incur from Amazon while using this module.
If you find any bugs or issues please raise them here.