Skip to content

Instantly share code, notes, and snippets.

@TeemuKoivisto
Last active June 1, 2017 13:36
Show Gist options
  • Save TeemuKoivisto/5a052716cc31ba67934ffdc9e6d0313e to your computer and use it in GitHub Desktop.
Save TeemuKoivisto/5a052716cc31ba67934ffdc9e6d0313e to your computer and use it in GitHub Desktop.
Guide to hosting a Node.js application on Elastic Beanstalk

How to setup Elastic Beanstalk pipelinen with Node.js, Travis and GitHub

  1. First create sample Elastic Beanstalk application from the AWS console.
  2. Then create IAM group and user with policy set to AWSElasticBeanstalkFullAccess.
  3. Copy the user Access Key Id and secret somewhere safe.
  4. Create a new project folder where you create your Node-app. Here's a premade setup if you are lazy: https://github.com/TeemuKoivisto/travis-aws-node
  5. Remember to add npm start script!
  6. Setup travis yml with travis init and travis setup elastic-beanstalk. Paste your access key and secret when prompted. You can use my project's .travis.yml as a guide.
  7. Since travis is stupid and can't actually properly setup your project you have to add manually bucket_name underneath deploy in your .travis.yml.
  8. Elastic Beanstalk already generated you a S3 bucket which name you should paste eg. bucket_name: "elasticbeanstalk-us-west-2-014750007983"
  9. Permissions for the bucket should already be set correctly so all you have to now is add & commit your code to GitHub.
  10. Check Travis to see if your project is building correctly.
  11. In a short while EB should replace the sample application with your own! Yey.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment