☁️

Introduction to AWS EC2 for Startups

Nov 15, 2024

Lecture Notes: Introduction to AWS EC2 and Creating an Instance

Story Introduction

  • Sophia works at a startup creating a website/app for locating tire air pumps.
  • Her boss, Alex, has the idea after having trouble finding an air pump for his car.
  • The startup uses an old Windows server donated by Sophia's uncle due to a limited budget.
  • The website gains traffic after a mention on Reddit causing the server to crash.
  • Sophia suggests using AWS and EC2 for scalable, reliable, and cost-effective hosting.

Understanding AWS EC2

  • EC2 (Elastic Compute Cloud): A virtual server rented in AWS.
    • Benefits:
      • Scalability: Easy to add more servers with features like auto scaling.
      • Reliability: Backup infrastructure globally, automatic replacements.
      • Integration: Works well with other AWS services (networking, storage, security).
      • Cost-effective: Pay as you use, no upfront hardware cost.

Launching an EC2 Instance

  • AWS Management Console: Interface to create/manage EC2 instances.
  • Steps to Launch an Instance:
    1. Choose AMI (Amazon Machine Image):
      • Base deployment unit with OS, application server, and software.
      • AWS provides various AMIs (Linux, Mac, Windows, etc.).
      • Select a free tier eligible AMI (e.g., Microsoft Windows Server 2019).
    2. Choose Instance Type:
      • Different combinations of CPU, memory, networking, and storage.
      • Select based on needs (e.g., T2 Micro for free tier).
    3. Configure Instance Details:
      • Pricing, networking (VPC, subnet), access management, shutdown behavior.
      • Default settings often sufficient; shutdown options: stop (temporary) or terminate (permanent).
    4. Add Storage:
      • Default EBS (Elastic Block Store) volume, 30GB SSD.
      • Option to add/change storage volumes.
    5. Add Tags:
      • Organize resources (e.g., environment: development).
    6. Configure Security Group:
      • Create firewall rules for traffic.
      • Default: RDP access, adjust as needed (best to restrict access).
    7. Review and Launch:
      • Verify settings, create key pair for login.
      • Launch instance and track status.

Connecting to an EC2 Instance

  • Connection Methods:
    • RDP (Remote Desktop Protocol) for Windows Server.
  • Logging In:
    • Use key pair to decrypt password for administrator login.

Post-Launch Actions

  • Terminate Instance:
    • Stop and terminate to avoid unnecessary costs.
    • Ensure all resources are properly managed and terminated if not in use.

Conclusion

  • EC2 offers an efficient, scalable solution for startups like Sophia's.
  • AWS provides powerful tools for managing server resources dynamically.
  • Encourage feedback and suggestions for further learning.