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');
var Options = awsCli.Options;
var Aws = awsCli.Aws;
Usage
With promise
var options = new Options(
'your key',
'your key2',
'your token',
null
);
var aws = new Aws(options);
aws.command('iam list-users').then(function (data) {
console.log('data = ', data);
});
With callback:
aws.command('iam list-users', function (err, data) {
console.log('data = ', data);
});
Typescript
import { Aws, Options } from 'aws-cli-js';
const options = new Options(
'your key',
'your key2',
'your token',
null
);
const aws = new Aws(options);
return aws.command('iam list-users').then(function (data) {
console.log('data = ', data);
});
awsCli.command('ec2 describe-instances --instance-ids i-789b3ba7').then(function (data) {
console.log('data = ', data);
});
License
MIT