Speaker
Sharada Prasad
EC2, S3 & VPC as DS/AI Infrastructure
Cloud infrastructure has accelerated advancement in DS/AI tremendously. AWS, as a top hyperscaler, offers a comprehensive, scalable, cost-effective platform for data storage, processing, analysis, and ML — letting data scientists and AI engineers focus on insights, not infrastructure. This masterclass proves that claim hands-on.
View full event announcement
00Before You Touch a Single Service
Every AWS masterclass that skips this step risks an unpleasant surprise bill. Do this first — it takes 15 minutes and it's non-negotiable.
AWS changed its Free Tier structure on July 15, 2025. Two different models now exist, and mixing them up is the #1 cause of surprise bills in classroom settings:
Accounts created before July 15, 2025: the legacy model — 750 hours/month of a t2.micro or t3.micro EC2 instance, free for 12 months from account creation, plus 5 GB of S3 storage.
Accounts created on or after July 15, 2025: the new "Free Plan" — $200 in credit, valid for 6 months (or until exhausted, whichever comes first). EC2, S3, and most paid services draw down against that single credit balance rather than having separate always-free hours.
Check which one applies to you on your AWS Billing console before this class starts — don't assume from an outdated blog post or tutorial, including this one. Terms change; verify on the official AWS Free Tier page at signup.
- Create an IAM user for today's work — never do hands-on labs logged in as the root account.
- Set a Billing budget alert — AWS Console → Billing → Budgets → create a $5 threshold alert. Takes 2 minutes, saves real money.
- Pick one AWS Region and stay in it for the whole class (e.g., us-east-1 or ap-south-1) — keeps resources easy to find and clean up.
- Use only t3.micro or t4g.nano instance sizes today — never a GPU or large instance during this class.
016-Hour Agenda
- 0:00–0:20
Why Cloud for DS/AI
Concept framing — why infrastructure was the bottleneck, and what AWS removes.
- 0:20–0:45
Setup & Cost Safety
IAM user, budget alert, region selection (Step 00 above).
- 0:45–2:00
Module 1 — EC2
Compute for DS/AI: launch, connect, run a real training script.
- 2:00–2:15
Break
- 2:15–3:30
Module 2 — S3
Storage for DS/AI: datasets, artifacts, and the EC2 ↔ S3 data flow.
- 3:30–3:45
Break
- 3:45–5:00
Module 3 — VPC
Networking for DS/AI: isolating and securing the infrastructure.
- 5:00–5:45
Capstone Lab
All three services working together as one DS/AI pipeline.
- 5:45–6:00
Cleanup & Next Steps
Resource teardown, cost check, certification path forward.
02Module 1 — EC2 as DS/AI Compute
Amazon EC2
Elastic Compute Cloud · 75 minGoal: launch a Linux server, connect to it, install a Python/ML environment, and run a real training script — proving EC2 is just "a computer you rent by the hour," sized to the job.
-
1Launch the instance
EC2 Console → Launch Instance → Amazon Linux 2023 AMI → instance type t3.micro. Create a new key pair and download the .pem file — you cannot re-download it later.
-
2Configure the security group
Allow inbound SSH (port 22) from "My IP" only — never "Anywhere" (0.0.0.0/0). Teaching moment: this is the first networking decision students make — it sets up Module 3.
-
3Connect
Use EC2 Instance Connect (browser-based, no SSH client setup needed) — click "Connect" in the console. This is the easiest path for a classroom of laptops on different operating systems.
-
4Set up the DS/AI environment
Install Python, pip, and the core DS stack:
sudo dnf install -y python3-pip pip3 install --user jupyter scikit-learn pandas numpy -
5Run a real training script
Create
train.pyand run a small, fast model — proving the instance can actually do DS/AI work, not just host a webpage:# train.py from sklearn.datasets import load_iris from sklearn.tree import DecisionTreeClassifier from sklearn.model_selection import train_test_split X, y = load_iris(return_X_y=True) X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2) clf = DecisionTreeClassifier().fit(X_train, y_train) print("Accuracy:", clf.score(X_test, y_test))python3 train.py -
6Discuss: sizing compute to the job
t3.micro was enough for this. Real deep learning uses GPU instances (e.g., the g4dn or p-series families) — don't launch one in class, just show the pricing page so students see the cost jump from cents/hour to dollars/hour, and understand why instance selection is itself an infrastructure decision.
03Module 2 — S3 as DS/AI Storage
Amazon S3
Simple Storage Service · 75 minGoal: create a bucket, move a dataset between S3 and EC2, and understand why object storage — not a local hard drive — is how real DS/AI teams manage data at scale.
-
1Create a bucket
S3 Console → Create bucket → globally unique name (e.g.,
yourname-dsai-masterclass) → same Region as your EC2 instance, to avoid cross-region transfer costs and latency. -
2Upload a dataset
Drag-and-drop any CSV (or use a public sample dataset) into the bucket via the console. This is the "data lake" pattern — raw data lives in S3, not on any one machine.
-
3Attach an IAM role to EC2 — not access keys
EC2 Console → your instance → Actions → Security → Modify IAM role → attach a role with
AmazonS3ReadOnlyAccess. Teaching moment: hardcoded access keys on a server are a classic security mistake — IAM roles are the correct pattern. -
4Pull the dataset onto EC2
Back on the EC2 instance (AWS CLI is pre-installed on Amazon Linux):
aws s3 cp s3://yourname-dsai-masterclass/dataset.csv . python3 -c "import pandas as pd; print(pd.read_csv('dataset.csv').head())" -
5Push results back to S3
Save your model's output and upload it — completing the round trip that defines a real DS/AI workflow:
aws s3 cp results.csv s3://yourname-dsai-masterclass/outputs/ -
6Discuss: storage classes & cost
S3 Standard vs. Intelligent-Tiering vs. Glacier — for a real ML data lake with terabytes of training data, storage class choice can be the difference between a reasonable and an unreasonable monthly bill.
04Module 3 — VPC as DS/AI Network Isolation
Amazon VPC
Virtual Private Cloud · 75 minGoal: understand why real DS/AI infrastructure — often handling sensitive data — isn't dropped into the internet-facing default network, and build a properly isolated environment.
-
1Default VPC vs. custom VPC
Every AWS account has a default VPC that's fully internet-connected. That's fine for a 5-minute demo — it is not how DS/AI infrastructure handling real (especially sensitive) data should be run in production.
-
2Create a custom VPC
VPC Console → Create VPC → "VPC and more" wizard → CIDR
10.0.0.0/16→ 1 public subnet, 1 private subnet, 1 Availability Zone (fine for a classroom exercise). -
3Understand the public/private split
The public subnet (with a route to an Internet Gateway) is where an EC2 instance needing internet access lives. The private subnet (no direct internet route) is where sensitive data-processing instances belong — reachable only from inside the VPC.
-
4Harden the security group from Module 1
Revisit the security group created earlier. Confirm SSH is still locked to "My IP" only, and — if Jupyter was ever opened on port 8888 to "Anywhere" — close that immediately. Teaching moment: this closes the loop on the risky shortcut some students may have taken in Module 1.
-
5VPC Gateway Endpoint for S3 (concept + demo)
Show — don't require hands-on due to time — how a Gateway Endpoint lets a private-subnet EC2 instance reach S3 without ever touching the public internet. This is the real pattern used for sensitive DS/AI data pipelines in industry.
05Capstone — All Three, Together
The Integrated DS/AI Pipeline
45 minStudents trace the full round trip end-to-end, in one sitting, with all three services visibly working together:
- 1An EC2 instance sits inside the custom VPC's public subnet, secured by a locked-down security group.
- 2It pulls a dataset from S3 using its attached IAM role — no hardcoded credentials anywhere.
- 3It trains a model on that data (the same pattern as Module 1, now on real infrastructure).
- 4It pushes results back to S3 — the same bucket, a new "outputs/" prefix.
This is, in miniature, exactly what the opening quote described: comprehensive, scalable, cost-effective infrastructure that lets a data scientist focus on the model — not on managing servers.
06Cleanup — Do Not Skip This
The single most common mistake in a hands-on AWS class: everyone goes home and the bill keeps running. Walk through this checklist together, on screen, before ending class.
- Terminate (not just "Stop") every EC2 instance created today.
- Empty and delete the S3 bucket — buckets with objects inside can't be deleted until emptied.
- Release any Elastic IP addresses allocated during the class.
- Delete the custom VPC — only possible after all dependent resources (instances, endpoints) are removed.
- Check the Billing Dashboard together — confirm the running total is at or near $0.
↗Where This Leads
Today's three services map directly onto the program's certification path — this masterclass is Day 1 of that roadmap, not a standalone event.