Deployment of node with Elastic Beanstalk (EB)

Setting up EB for the first time

Use the below abbreviated instructions and refer to the AWS docs as needed.

Python 2.7 or 3.4, and pip must be installed on your machine

Install EB CLI

Setting up the EB deployment

Configuration

Once deployment is complete, on AWS Web Console select Elastic Beanstalk > your app > Configuration.

Instances

Change the Instance Type from t1.micro to m1.small, or whatever makes sense for the deployment. Don't leave it on micro.

Some instances are meant to work in VPC and others without, ask a Systems Engineer if you are not sure what to choose.

Software Configuration

Load Balancer

If you are setting your app to redirect HTTP to HTTPS on the box (meaning, in your app code, and not on the load balancer) make sure you are checking against the X-Forwarded-Proto header. In Express you can app.set( "trust proxy", true ) and it will use that header in place of req.protocol. KeystoneJS works the same since it uses Express, but the option is set in keystone.init( { "trust proxy": true } ) instead.

Debugging

View the Logs page and review any crashes. A crash is most likely to manifest as seeing an nginx 502 page in the browser.

Deploying updates

Shutting down the deployment

You probably will only do this if you were running a test or a project has ended, don't do this with anything you actually want to be available online