Objective
Deploy a Linux server, connect it to a MySQL database, create storage, and upload files to S3.
Services covered:
- EC2
- Linux
- RDS MySQL
- EBS
- EFS
- S3
Part 1 – EC2 (20%)
Task 1
Create an Ubuntu EC2 instance.
Requirements:
- Name:
student-ec2 - Instance type: t2.micro
- Create a new Security Group
- Allow SSH (22)
Task 2
Connect using SSH.
Run:
hostname
whoami
pwd
df -h
free -h
lsblk
Explain what each command shows.
Part 2 – EBS (20%)
Create a new EBS volume.
Requirements:
- 5 GB
- Same Availability Zone as EC2
Attach it.
On Ubuntu:
lsblk
sudo mkfs.ext4 /dev/nvme1n1
sudo mkdir /data
sudo mount /dev/nvme1n1 /data
df -h
Create:
echo "JumpToTech" > /data/test.txt
cat /data/test.txt
Part 3 – EFS (15%)
Create:
- EFS
- Mount Target
Mount it on EC2.
Create:
sudo mkdir /efs
Mount.
Create:
echo "Hello EFS" > /efs/file1.txt
Verify.
Part 4 – S3 (15%)
Create bucket:
student-firstname-lastname
Upload
resume.pdf
OR
hello.txt
Create another file on EC2.
Upload using AWS CLI.
Example:
aws s3 cp hello.txt s3://bucket-name/
List objects.
Part 5 – RDS MySQL (20%)
Create:
- MySQL
- admin user
Connect EC2 to RDS.
Install MySQL Client.
Connect.
Run:
SHOW DATABASES;
Create:
CREATE DATABASE school;
Use it:
USE school;
Create table:
CREATE TABLE students(
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50),
course VARCHAR(50)
);
Insert:
INSERT INTO students(name,course)
VALUES
('John','DevOps'),
('Emma','AWS');
Verify:
SELECT * FROM students;
Part 6 – Linux (10%)
Create user:
sudo adduser devops
Create group:
sudo groupadd engineers
Add user:
sudo usermod -aG engineers devops
Create:
mkdir project
Create:
touch project/app.log
Change owner:
sudo chown devops:engineers project
Verify.
Deliverables
Students should submit screenshots of:
- EC2 Running
- SSH Connected
df -hlsblk- Mounted EBS
- Mounted EFS
- S3 Bucket
- Uploaded Object
- RDS Available
- MySQL Connection
SHOW DATABASES;SELECT * FROM students;
Bonus Questions (Interview Style)
- What is the difference between EBS and EFS?
- Why can't we SSH into RDS?
- Why did we install MySQL Client on EC2?
- Why is port 3306 used?
- What is the purpose of a Security Group?
- Why is RDS a managed service?
- What is the difference between S3 and EBS?
- Why must the EBS volume be in the same Availability Zone as the EC2 instance?
- Can two EC2 instances use the same EBS volume simultaneously?
- When would you choose EFS instead of EBS?
This lab is realistic, reinforces all the services they've learned, and introduces the way a DevOps engineer connects compute, storage, networking, and databases in a simple production-like environment.
Top comments (0)