mmi-aws-api

1.0.11 • Public • Published

Welcome to MMI AWS API

The main scope of this application is to start & stop aws ec2 instance. Where before start the instance we check the status of instance whether its available or not and do with respect to it.

Installation

$ npm install mmi-aws-api

Usage

copy below code to start ec2 instance inside index.js

var awsMMIApi = require('mmi-aws-api');
var instanceId = "blah";
var region = "blah";
var debug = false;
awsMMIApi.startInstance(instanceId,region,debug,function (response) {
  console.log(response);
});

copy below code to stop ec2 instance inside index.js

var awsMMIApi = require('mmi-aws-api');
var instanceId = "blah";
var region = "blah";
var debug = false;
awsMMIApi.stopInstance(instanceId,region,debug,function (response) {
  console.log(response);
});

copy below code to check status ec2 instance inside index.js

var awsMMIApi = require('mmi-aws-api');
var instanceId = "blah";
var region = "blah";
var debug = false;
awsMMIApi.instanceStatus(instanceId,region,debug,function (response) {
  console.log(response);
});

then run

node index.js

Prerequisites

  1. At AWS >> IAM >> add new user >> give permission to start, stop instance
  2. Get the secret key & access key
  3. Copy below commands in terminal
  which python
  python --version
  pip --version
  sudo apt install python-pip
  pip install --user awscli
  which aws
  aws configure

Note: Here it will ask access key, secret key & region. Check reference (1) video for this steps

References:

  1. Install AWS CLI using Python PIP
  2. Managing Amazon EC2 Instances using nodejs

Readme

Keywords

Package Sidebar

Install

npm i mmi-aws-api

Weekly Downloads

3

Version

1.0.11

License

ISC

Unpacked Size

7.19 kB

Total Files

3

Last publish

Collaborators

  • raghu87