aws-nodejs
Starter kit for aws tasks
Last updated 8 months ago by awallef .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install aws-nodejs 
SYNC missed versions from official npm registry.

aws-nodejs

Starter kit for aws complex tasks

This packages is build on top of

  • aws-sdk
  • redux
  • yargs

It offers you a solid start point to create bin taks using the power of js, args/command managemnt wrap by popuplar yargs lib and the flux architecture:

Install

via git

git clone https://github.com/3xw/aws-nodejs.git

via npm

npm install aws-nodejs -g

configure

Be sure to have a .aws folder in your user folder Configuration and Credential Files.

Then create the file config/main.js with following.

module.exports = {
  ownerId: 'xxxx-your-id',
  region: 'eu-central-1' // your own
}

use

$ nodeaws help:

$ bin/nodeaws help
nodeaws [command]

Commands:
	nodeaws backupEc2Volumes  creates fresh snapshots an deletes old ones
	nodeaws backupRdsCluster  creates fresh snapshot of a db cluster an deletes old ones

Options:
	--version  Show version number                                       [boolean]
	--help     Show help                                                 [boolean]

$ nodeaws backupEc2Volumes:

$ bin/nodeaws backupEc2Volumes

creates fresh snapshots an deletes old ones

Options:
  --version          Show version number                               [boolean]
  --help             Show help                                         [boolean]
  -u, --delayUnits   Delay units to use: seconds| minutes | hours | days | weeks
                     | months | years                                 [required]
  -a, --delayAmount  Delay amount 1, 2 etc                            [required]

$ nodeaws backupRdsCluster

$ bin/nodeaws backupRdsCluster

creates fresh snapshot of a db cluster an deletes old ones

Options:
  --version          Show version number                               [boolean]
  --help             Show help                                         [boolean]
  -n, --name         Name of the cluster                              [required]
  -u, --delayUnits   Delay units to use: seconds| minutes | hours | days | weeks
                     | months | years                                 [required]
  -a, --delayAmount  Delay amount 1, 2 etc                            [required]

$ crontab -e:

#######
# aws #
#######
30 * * * * /data01/scripts/aws-nodejs/bin/nodeaws backupRdsCluster -n database03-cluster -a 24 -u hours > /data01/logs/aws-nodejs__backupRdsCluster.log 2>&1
40 0 * * * /data01/scripts/aws-nodejs/bin/nodeaws backupEc2Volumes -a 1 -u weeks > /data01/logs/aws-nodejs__backupEc2Volumes.log 2>&1

create your own

Go to files:

bin/awsnode

add your new cmd and create it or copy one from for ex:

src/cmd/backupRdsCluster.js

Have fun ????

Current Tags

  • 0.0.6                                ...           latest (8 months ago)

6 Versions

  • 0.0.6                                ...           8 months ago
  • 0.0.5                                ...           8 months ago
  • 0.0.4                                ...           8 months ago
  • 0.0.3                                ...           8 months ago
  • 0.0.2                                ...           8 months ago
  • 0.0.1                                ...           9 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 8
Dependencies (6)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |