# aws-helpers

> AWS Helpers for NodeJS

Latest version **0.0.15** (published 2016-03-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install aws-helpers
pnpm add aws-helpers
yarn add aws-helpers
bun add aws-helpers
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.15 |
| Published | 2016-03-13 |
| First published | 2016-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | NalindaK |
| Maintainers | nalindak |
| Keywords | NodeJS, AWS, Helpers |

## Links

- npm: https://www.npmjs.com/package/aws-helpers
- Repository: https://github.com/nalindak/aws-helpers
- Issues: https://github.com/nalindak/aws-helpers/issues
- npm.io page: https://npm.io/package/aws-helpers

## Dependencies (2)

- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.2.37
- [bluebird](https://npm.io/package/bluebird.md) ^3.3.1

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.0.15 (latest) — 2016-03-13
- 0.0.14 — 2016-03-12
- 0.0.13 — 2016-03-03
- 0.0.12 — 2016-03-03
- 0.0.11 — 2016-03-01
- 0.0.9 — 2016-03-01
- 0.0.8 — 2016-03-01
- 0.0.6 — 2016-02-26
- 0.0.5 — 2016-02-25
- 0.0.4 — 2016-02-25
- 0.0.4444 — 2016-02-25
- 0.0.3 — 2016-02-24
- 0.0.2 — 2016-02-21
- 0.0.1 — 2016-02-21

## README

[![Build Status](https://travis-ci.org/nalindak/aws-helpers.svg?branch=master)](https://travis-ci.org/nalindak/aws-helpers) [![Code Climate](https://codeclimate.com/github/nalindak/aws-helpers/badges/gpa.svg)](https://codeclimate.com/github/nalindak/aws-helpers) [![Test Coverage](https://codeclimate.com/github/nalindak/aws-helpers/badges/coverage.svg)](https://codeclimate.com/github/nalindak/aws-helpers/coverage) [![Issue Count](https://codeclimate.com/github/nalindak/aws-helpers/badges/issue_count.svg)](https://codeclimate.com/github/nalindak/aws-helpers)

#AWS Helpers for NodeJS

AWS Helpers is a node.js helper library, which eliminates lot of boilerplate around aws-sdk for NodeJS

## PreReq

  Note that AWS helpers won't manage AWS credentials for you, it is rely on either `~/.aws/credentials` or `environment` variables. Therefore it is expected that you have defined them using following methods,

  - via credentials file

```bash
[default]
aws_access_key_id = <YOUR_ACCESS_KEY_ID>
aws_secret_access_key = <YOUR_SECRET_ACCESS_KEY>
```

  - via environment varaibles

```bash
export AWS_ACCESS_KEY_ID=<YOUR_ACCESS_KEY_ID>
export AWS_SECRET_ACCESS_KEY=<YOUR_SECRET_ACCESS_KEY>
```

  You may defined AWS region as below,

```bash
export AWS_REGION=<YOUR_REGION>
```

## Installation

```bash
$ npm install aws-helpers
```

## Quick start & usage

  cloudformation method `describe-stacks`

```js
'use strict';

var awsHelpers = require('aws-helpers');

awsHelpers.cloudformation.describeStacks({
    StackName: 'STACK-NAME'
}).then(function (item) {
    console.log(item);
}).catch(function (reason) {
    console.log(reason);
});
```

  output :
```sh
{ ResponseMetadata: { RequestId: 'xxxxxxxxxxxxxxxxxx },
  Stacks:
   [ { StackId: 'arn:aws:cloudformation:xxxxxxxx:stack/STACK-NAME/xxxxxxxx',
       StackName: 'STACK-NAME',
       Description: 'Description',
       Parameters: [Object],
       CreationTime: Fri Nov 21 2014 14:34:38 GMT+1100 (AEDT),
       LastUpdatedTime: Wed Feb 24 2016 15:19:09 GMT+1100 (AEDT),
       StackStatus: 'UPDATE_COMPLETE',
       DisableRollback: false,
       NotificationARNs: [],
       Capabilities: [Object],
       Outputs: [Object],
       Tags: [] } ] }
```

  ec2 method `findByTag`

 ```js
 'use strict';

 var awsHelpers = require('aws-helpers');

 awsHelpers.ec2.findByTag([
     {
       Name: 'name',
       Values: [
         'NAME'
       ]
     }
 ]).then(function (item) {
     console.log(item);
 }).catch(function (reason) {
     console.log(reason);
 });
 ```

  output :

```sh
{ Images:
   [ { ImageId: 'ami-xxxxx',
       ImageLocation: 'xxxxxx/NAME',
       State: 'available',
       OwnerId: 'xxxxxx',
       CreationDate: '2016-02-24T05:40:03.000Z',
       Public: false,
       ProductCodes: [],
       Architecture: 'x86_64',
       ImageType: 'machine',
       SriovNetSupport: 'simple',
       Name: 'NAME',
       RootDeviceType: 'ebs',
       RootDeviceName: '/dev/sda1',
       BlockDeviceMappings: [Object],
       VirtualizationType: 'hvm',
       Tags: [Object],
       Hypervisor: 'xen' } ] }
```

 cloudformation method `createWait`

```js
'use strict';

var awsHelpers = require('aws-helpers');

var params = {
  StackName: 'STACK-NAME',
  // Sample stack parameters - Example only
  Parameters: [
    {
      ParameterKey: 'DeadLetterMaxReceiveCount',
      ParameterValue: '1',
      UsePreviousValue: false
    }
  ],
  TemplateURL: 'https://xxxx/xxxx.json',
  UsePreviousTemplate: true
};

awsHelpers.cloudformation.createWait(params)
    .then(function (result) {
        console.log(result);
    }).catch(function (reason) {
        console.log(reason.message);
    });
```

 output:

```sh
STACK-NAME : is in non transitioning state
```

 cloudformation method `updateWait`

 ```js
 'use strict';

 var awsHelpers = require('aws-helpers');

 var params = {
   StackName: 'STACK-NAME',
   // Sample stack parameters - Example only
   Parameters: [
     {
       ParameterKey: 'DeadLetterMaxReceiveCount',
       ParameterValue: '1',
       UsePreviousValue: false
     }
   ],
   UsePreviousTemplate: true
 };

 awsHelpers.cloudformation.updateWait(params)
     .then(function (result) {
         console.log(result);
     }).catch(function (reason) {
         console.log(reason.message);
     });
 ```

  output:

```sh
STACK-NAME : is in non transitioning state
```

cloudformation method `pollStackStatus`

var awsHelpers = require('aws-helpers');

function stackReady(params) {
        console.log('Executing stackReady')

        return awsHelpers.cloudformation.pollStackStatus(params)
            .then(function (result) {
                console.log(result);
            })
            .catch(function (reason) {
                console.log(reason);
            });
}

stackReady({
    StackName: 'STACK-NAME'
});

 output:

Executing stackReady
STACK-NAME : is in non transitioning state

autoscaling method `resumeAutoscaling`

```js
'use strict';

var awsHelpers = require('aws-helpers');

var params = {
  AutoScalingGroupName: 'STRING_VALUE',
  ScalingProcesses: [
    'STRING_VALUE'
  ]
};

awsHelpers.autoscaling.resumeAutoscaling(params)
    .then(function (result) {
        console.log(result);
    }).catch(function (reason) {
        console.log(reason.message);
    });
```

 output:

```sh
Executing resumeAutoscaling
```

autoscaling method `suspendAutoscaling`

```js
'use strict';

var awsHelpers = require('aws-helpers');

var params = {
  AutoScalingGroupName: 'STRING_VALUE',
  ScalingProcesses: [
    'STRING_VALUE'
  ]
};

awsHelpers.autoscaling.suspendAutoscaling(params)
    .then(function (result) {
        console.log(result);
    }).catch(function (reason) {
        console.log(reason.message);
    });
```

 output:

```sh
Executing suspendAutoscaling
```
autoscaling method `describeAutoScaling`

```js
'use strict';

var awsHelpers = require('aws-helpers');

var params = {
  AutoScalingGroupNames: [
    'AUTO-SCALING-GROUP-NAME'
  ],
};

awsHelpers.autoscaling.describeAutoScaling(params)
    .then(function (result) {
        console.log(result);
    }).catch(function (reason) {
        console.log(reason.message);
    });
```

 output:

```sh
Executing describeAutoScaling
{ ResponseMetadata: { RequestId: 'xxxxxxxxxxx' },
  AutoScalingGroups:
   [ { AutoScalingGroupName: 'AUTO-SCALING-GROUP-NAME',
       AutoScalingGroupARN: 'xxxxxxxxxx',
       LaunchConfigurationName: 'AUTO-SCALING-GROUP-NAME-LC',
       MinSize: 1,
       MaxSize: 1,
       DesiredCapacity: 1,
       DefaultCooldown: 300,
       AvailabilityZones: [Object],
       LoadBalancerNames: [Object],
       HealthCheckType: 'ELB',
       HealthCheckGracePeriod: 300,
       Instances: [Object],
       CreatedTime: Thu Oct 29 2015 05:39:51 GMT+1100 (AEDT),
       SuspendedProcesses: [],
       VPCZoneIdentifier: 'xxxxxxxx',
       EnabledMetrics: [],
       Tags: [Object],
       TerminationPolicies: [Object],
       NewInstancesProtectedFromScaleIn: false } ] }
```

---
_Source: https://npm.io/package/aws-helpers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
