ADVERTISEMENT
Google AdSense Slot (headerLeaderboard)

Set your Publisher ID in src/config/ads.ts to display live ads.

AWS Cloud Computing Tutorial• 7 min read

EC2: Elastic Compute Cloud & Virtual Servers

Instance types, AMIs, SSH Key Pairs, and Security Group firewalls

Amazon EC2 provides resizable virtual computing capacity in the cloud, allowing you to launch Linux or Windows virtual machines (instances) in minutes.

EC2 Instance Anatomy

AMI (Amazon Machine Image): Pre-configured operating system template (Ubuntu, Amazon Linux 2023, Windows Server).

Instance Types: Categorized by resource ratios (e.g. t4g.micro for general burstable, c7g for compute-heavy, r7g for memory-intensive).

Security Groups: Virtual stateful firewalls controlling inbound and outbound network traffic to instances.

EBS (Elastic Block Store): Persistent high-performance network-attached SSD block storage volumes attached to instances.

Connecting to EC2 via SSH
# Ensure SSH private key has correct restricted permissions
chmod 400 my-key-pair.pem

# Connect to EC2 instance using public IP or DNS
ssh -i "my-key-pair.pem" ubuntu@ec2-54-210-45-12.compute-1.amazonaws.com

# Once inside: Update packages and install Nginx
sudo apt update && sudo apt install -y nginx
sudo systemctl start nginx
Connects securely via asymmetric key pairs without transmitting passwords.
ADVERTISEMENT
Google AdSense Slot (inContentBanner)

Set your Publisher ID in src/config/ads.ts to display live ads.

Test Yourself With Exercise

+15 XP

What acts as a virtual stateful firewall controlling inbound and outbound traffic to an EC2 instance?