devops-exercises/exercises/aws/solutions/elastic_beanstalk_simple.md
2022-04-01 14:57:26 +03:00

1.4 KiB

AWS Elastic Beanstalk - Node.js

Prerequisites

  1. make sure the node.js application has a npm start command specified in the package.json file like the following example
{

  "name": "application-name",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node app"
  },
  "dependencies": {
    "express": "3.1.0",
    "jade": "*",
    "mysql": "*",
    "async": "*",
    "node-uuid": "*"
} 
  1. zip the application, and make sure to not zip the parent folder, only the files together, like:
\Parent - (exclude the folder itself from the the zip)
- file1 - (include in zip)
- subfolder1 (include in zip)
- file2 (include in zip)
- file3 (include in zip)

Solution

  1. Create a "New Environment"
  2. Select Environment => Web Server Environment
  3. Fill the Create a web server environment section a. Fill the "Application Name"
  4. Fill the Environment information section a. Fill the "Environment Name" b. Domain - "Leave for autogenerated value"
  5. Platform a. Choose Platform => node.js
  6. Application Code => upload the Zipped Code from your local computer
  7. Create Environment
  8. Wait for the environment to come up
  9. Check the website a. Navigate to the Applications tab, b. select the recently created node.js app c. click on the URL - highlighted

Documentation

Elastic Beanstalk / Node.js getting started