DEV Community

Cover image for AWS in a Nutshell
Jayant
Jayant

Posted on

AWS in a Nutshell

AWS

Most Commonly Used Terms

  1. EC2 - It stands for Elastic Compute version-2, compute referred to a part of a big machine.Elastic means we can upscale or downscale it. Basically a server running elsewhere.

  2. S3 - It is used to store objects, objects referred to things that doesn't have any Data type, such as Video file, audio file , image file etc. S3 stands for Simple storage Device.

3) CloudFront - It is basically a Content Delivery Network[ CDN ] that is used to deliver the static content to the user faster.

Deplying Backend to the EC2 machine

-----ChatGPT-----
Learnings

  • SSH - It stands for secure shell. It helps you connect to the other machine shell securely.
//ssh using mac
chmod 700 xyz.pem
ssh -i xyz.pem ubuntu@your_server_url

//ssh using windows
//1) Download Git bash
//2) Run it as Administrator
//3) Go the folder where xyz.pem file is present
chmod 700 xyz.pem
ssh -i xyz.pem ubuntu@your_server_url
Enter fullscreen mode Exit fullscreen mode
  • using vi editor - To use vi editor type
sudo vi /myfolder/index.js
// type 'i' for insert mode
// 'esc' to get back
// ':wq'+enter to save the file
Enter fullscreen mode Exit fullscreen mode
  • To deploy the backend we primarily need EC2 server.

  • Suppose you want to deploy multiple application on save server due to some money issues.
    It will look like this

   your_url:3000  - for 1st website
   your_url:3001 - for 2nd website
Enter fullscreen mode Exit fullscreen mode

But there is a problem you don't want the user to enter the port & you also want that Different subdomain that lead to same ip will point to your_url & at the server you decide where to redirect the user.
You can do this is using nginx, it is a webserver software that provides service called reverse-proxy.

Nginx
Default port is 80 for http
and for https it is 433
If we go to http:your_url then it will point to port 80.

  • For free SSL certificate - Certbot

Deplying Frontend

-----ChatGPT-----

  • To do so upload all the static files in S3 bucket, then use Cloudfront to deliver the content.

  • Why can't we use CDN in server also, in server side every request is unique that can only be handled by the server.

  • Initally after setting up cloudfront you will got a url , to access something u have do like this https:your_url/index.html.

BONUS

  • You can have multiple subdomains after buying one domain.

Top comments (0)