1.0.11 • Published 2 years ago

mmi-aws-api v1.0.11

Weekly downloads
4
License
ISC
Repository
-
Last release
2 years ago

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
1.0.11

2 years ago

1.0.7

2 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago