Skip to content

Instantly share code, notes, and snippets.

@ninadpchaudhari
Last active November 27, 2023 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ninadpchaudhari/da0f5f2800aa8aaa028337a1db8345f4 to your computer and use it in GitHub Desktop.
Save ninadpchaudhari/da0f5f2800aa8aaa028337a1db8345f4 to your computer and use it in GitHub Desktop.
Lab - Introduction to AWS Deploy.

Objectives

  • Have Fun!!!
  • Understand and discussion the deploy phase of an application.
  • Introduction to cloud computing and self hosting.
  • Stepping stone towards DevOps and Containerization.
  • Stepping stone towards utilizing existing APIs.
  • Reading and understanding Documentation; Extracting relevant information and potentially transferring concepts to other apps / cloud providers.
  • Slides

Deliverables:

On Canvas

  • The link to your app running online in AWS.
  • Reflections.
  • Anything else you think that comes in the way / is helpful.

Create a public cloud account : AWS

  1. Create AWS Account
  2. Demo - Create an EC2 instance. please use Ubuntu for now.
  3. Reference: AWS - EC2 getting started
  4. Track your current Free Usage.
  5. Goto EC2 dashboard.

Open the 3000 port in Security Groups

Reference

  • Click on Security
  • clck on the security group for your instance
  • Click on Edit inbound rules
  • Then add rule for port 3000 from Anywhere

Test if 3000 is open!

  1. Install NodeJS
  2. Install a simple HTTP server sudo npm install -g http-server
  3. Run the server to listen on port 3000 http-server --port 3000
  4. Check the address of your instance and make sure it works!! http://<Your address here>:3000

Deploy an ExpressJS app

  1. Install PM2
  2. git clone or transfer your earlier code to this instance. You make this easier by just having a simple helloworld app found on expressjs.com to begin with.
  3. Install Dependencies : npm install
  4. Start the app using PM2 pm2 start ./bin/www Quickstart
  5. Verify it works!

Further directions

  • Deploy your clientside app as well!? One idea is to combine your Lab 7 (Frontend) work with Lab 9 work and deploy this web app.
  • Deploy on Google / Azure cloud services.
  • Deploy a Database server to go with this.
  • serve your website on HTTPS instead of HTTP
  • Auto scale your EC2 instances
  • Use environment variables.
  • Use AWS Beanstalk to deploy your app instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment