AWS Certified Cloud Practitioner / EC2 - Elastic Compute Cloud

EC2 Basics

In this lecture, we are going to talk about Amazon EC2, and this is where we will create our first website on AWS.

❓ What is EC2?

EC2 — Elastic Compute Cloud — is one of AWS's flagship services. It's Infrastructure as a Service (IaaS): you rent virtual machines on demand, instead of buying and running physical servers.


🚀 EC2 isn't just one thing

It's a family of related pieces:

  • 🖥️ Instances — the virtual machines themselves

  • 💾 EBS Volumes — attached storage

  • ⚖️ Elastic Load Balancer — spreads traffic across instances

  • 📈 Auto Scaling Group — adds or removes instances automatically

We'll dig into each of these later — for now, just know they exist.


🧐 Why EC2 Matters

EC2 is the clearest example of what "cloud computing" actually means: rent compute power, use it when you need it, scale it up or down as demand changes.


🤖 What you configure when launching an instance

  • Operating system — Linux (most common), Windows, or macOS

  • Compute power — number of CPU cores

  • Memory — how much RAM

  • Storage — network-based (EBS/EFS) or hardware-attached (Instance Store)

  • Networking — speed, public IP, network setup

  • Security — Security Groups, which act as your instance's firewall


🧮 User Data — the bootstrap script

This is a script that runs once, automatically, the moment the instance launches — a way to set things up without doing it by hand.

Bootstrapping just means: running commands automatically at startup.

What people typically use it for:

  • Installing updates

  • Installing software

  • Downloading files

  • Configuring the application

More steps in the script means more time before the instance is ready.

⚠️ One important detail: User Data scripts run as root — full sudo access, no restrictions.


The short version

EC2 lets you rent virtual machines on demand. You control the OS, CPU, RAM, storage, and networking. It bundles in storage, scaling, and load balancing. User Data lets you automate first-boot setup. And understanding EC2 is basically understanding the core idea of the cloud.