Skip to content

Instantly share code, notes, and snippets.

@viniciusCamargo
Last active November 27, 2017 03:51
Show Gist options
  • Save viniciusCamargo/30d49bd3adc38aa2a9d210f2970fd418 to your computer and use it in GitHub Desktop.
Save viniciusCamargo/30d49bd3adc38aa2a9d210f2970fd418 to your computer and use it in GitHub Desktop.
How to quickly create and deploy an Node.js app to AWS Elastic Beanstalk
node_modules
.elasticbeanstalk

How to quickly create and deploy an Node.js app to AWS Elastic Beanstalk

  1. Create an Elastic Beanstalk application named after the current folder:

eb init --platform node.js --region sa-east-1

  1. Create a load balanced environment with the default settings for Node.js:

eb create --sample node-express-env

  1. Set the Node Command to "npm start":

.ebextensions/nodecommand.config

option_settings:
  aws:elasticbeanstalk:container:nodejs:
    NodeCommand: "npm start"
  1. Stage the files to Git repository (add & commit).

  2. Deploy the changes:

eb deploy node-express-env

  1. Open command to open the environment's URL in the default browser:

eb open

  1. Terminate your environment and all of the resources that it contains:

eb terminate node-express-env

References

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs_express.html http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html

TODO

  • create a bash script to automate the task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment