aws-cli-js
A node.js wrapper for the aws-cli command line interface
Installation
Step 1: Prerequisites
The aws command line interface must be installed and accessible in the path
Step 2: Installation
npm install aws-cli-js
Then:
var AwsCli = require('aws-cli-js');
Usage
With promise
var awsCli = new AwsCli({
aws_access_key_id: 'PUTVALUEHERE',
aws_secret_access_key: 'abcdefPUTVALUEHERE',
});
awsCli.command('iam list-users').then(function (data) {
console.log('data = ', data);
});
With callback:
awsCli.command('iam list-users', function (err, data) {
console.log('data = ', data);
});
awsCli.command('ec2 describe-instances --instance-ids i-789b3ba7').then(function (data) {
console.log('data = ', data);
});
or with options
awsCli.command('ec2 describe-instances', { 'instance-ids': instance_id }).then(function (data) {
console.log('data = ', data);
});