Socket
Socket
Sign inDemoInstall

node-aws-beanstalk

Package Overview
Dependencies
50
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    node-aws-beanstalk

A module to help you automate AWS beanstalk app deployment.


Version published
Maintainers
1
Install size
56.8 MB
Created

Readme

Source

node-aws-beanstalk

A module that helps you automate AWS beanstalk application deployment. All application and environment configuration is managed in the codebase. So you can version control everything and automate the deployment instead of click click click in AWS console.

Inspired by https://github.com/ThoughtWorksStudios/node-aws-lambda

Gulp example:

gulpfile.js

var gulp = require('gulp');
var zip = require('gulp-zip');
var del = require('del');
var install = require('gulp-install');
var runSequence = require('run-sequence');
var awsBeanstalk = require("node-aws-beanstalk");

gulp.task('clean', function() {
  return del(['./dist', './dist.zip']);
});

gulp.task('js', function() {
  return gulp.src('index.js')
    .pipe(gulp.dest('dist/'));
});

gulp.task('node-mods', function() {
  return gulp.src('./package.json')
    .pipe(gulp.dest('dist/'))
    .pipe(install({production: true}));
});

gulp.task('zip', function() {
  return gulp.src(['dist/**/*', '!dist/package.json'])
    .pipe(zip('dist.zip'))
    .pipe(gulp.dest('./'));
});

gulp.task('upload', function(callback) {
  awsBeanstalk.deploy('./dist.zip', require("./beanstalk-config.js"), callback);
});

// update task can be used to update the configured environment
gulp.task('update', function(callback) {
  awsBeanstalk.update(require("./beanstalk-config.js"), callback);
});

gulp.task('deploy', function(callback) {
  return runSequence(
    ['clean'],
    ['js', 'node-mods'],
    ['zip'],
    ['upload'],
    callback
  );
});

beanstalk-config.js

module.exports = {
  accessKeyId: <access key id>,  // optional
  secretAccessKey: <secret access key>,  // optional
  profile: <shared credentials profile name>, // optional for loading AWS credientail from custom profile
  region: '<region>',
  appName: 'MyApp',

  // either the 'solutionStack' OR 'template' key MUST be provided, but not both
  solutionStack: '64bit Amazon Linux 2015.03 v2.0.6 running Node.js',
  template: 'myEnvironmentTemplate',

  version: '0.1.0', // optional, else will pull version from package.json
  S3Bucket: 'mys3bucket', // DEPRECATED - use bucketConfig.Bucket
  tier: 'Worker', // optional, else will use 'WebServer'
  environmentSettings: [
    {
      Namespace: 'aws:autoscaling:launchconfiguration',
      OptionName: 'IamInstanceProfile',
      Value: 'ElasticBeanstalkProfile'
    },
    // ...
  ],
  environmentTags: [ // optional
    {
      key: 'foo',
      value: 'bar'
    },
    // ...
  ],
  bucketConfig: { // optional - passed into S3.createBucket()
    Bucket: 'mys3bucket', // optional, else will attempt to use appName
    // ...
    CreateBucketConfiguration: {
      LocationConstraint: 'eu-west-1', // optional, note this region should match the application's target region (see http://blog.mikebabineau.com/2013/08/21/multi-region-gotcha-on-elastic-beanstalk/)
    },
  },
  bucketTags: [ // optional
    {
      key: 'foo',
      value: 'bar'
    },
    // ...
  ]
}

Additional environment settings can be found here.

Proxy setup

Deployment via https proxy is supported by setting environment variable "HTTPS_PROXY". For example:

> HTTPS_PROXY="https://myproxy:8080" gulp deploy

License

(The MIT License)

Copyright (c) 2015 David Hutchings

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

FAQs

Last updated on 28 Feb 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc