Alif Najmi
← Back to Alif Notes · Coursework

One VPC, two departments, $56

6 November 2026 · 3 min read

For TEB3033 (Distributed and Parallel Computing), my group of four got a classic brief. One company, two departments with opposite needs: HR wants a portal anyone on the internet can open, while Engineering wants a development server nobody outside can reach. And neither department's admins should be able to touch the other's setup. The budget was the $100 credit in an AWS Academy Learner Lab.

It's simple stuff, but it's the kind of simple that's easy to get subtly wrong, so here's how we approached it.

The whole design in one picture

Secure two-department AWS architectureOne VPC (10.0.0.0/16) with a public HR subnet reachable from the internet on port 80 through an internet gateway, and a private Engineering subnet with no route to the gateway that only accepts traffic from the HR server. IAM groups manage only resources tagged with their department.VPC · 10.0.0.0/16Public subnet · HRPrivate subnet · EngineeringIAM · who manages whatHTTP :80internal API callno way inPublic usersthe internetInternetGatewayHR web servert3.micro · Apache10.0.1.10HR-SGport 80 ← anyoneport 22 ← admin IP onlyEngineering servert3.micro · no public IP10.0.2.10Eng-SGonly from 10.0.1.10route table: local only, no path to the gatewayHR-Adminscan manage onlyDepartment = HREng-Adminscan manage onlyDepartment = EngineeringBoundary testHR admin edits Eng→ Access Denied
One VPC, two subnets, and IAM rules based on a Department tag. Swipe sideways to see all of it.

Three locks, not one

Engineering's isolation doesn't rely on any single setting. Each layer would hold even if another one were misconfigured:

  • The route table. The private subnet simply has no route to the internet gateway. Traffic from the internet isn't blocked so much as it has no road to travel on.
  • The security group. Engineering only accepts connections from one address: the HR server's private IP. HR itself only opens port 80 to the world, and SSH only to the admin's IP.
  • IAM. Every resource is tagged Department: HR or Department: Engineering when it's created, and each admin group can only manage resources carrying its own tag.

One rule per department

The IAM side is one small policy per group. VPC networking actions share the ec2: namespace, so a single statement covers servers, subnets, route tables and gateways. The Engineering policy is the same with a different tag value.

{
  "Effect": "Allow",
  "Action": "ec2:*",
  "Resource": "*",
  "Condition": { "StringEquals": {
    "aws:ResourceTag/Department": "HR" } }
}

To prove the boundary, the plan creates a test user for each group, signs in as the HR admin, and tries to change Engineering's network. The expected answer is "Access Denied", while the same admin keeps full control of anything tagged HR.

Three journeys

WhoWhat happensResult
A visitor opens the HR portalThrough the gateway, past HR-SG on port 80, to ApachePage loads ✓
Someone aims at Engineering from outsideNo public IP to find, and no route in even if they had oneDead end ✗
The HR server calls Engineering10.0.1.10 to 10.0.2.10 inside the VPC, allowed by Eng-SGWorks ✓

Half the budget

The network itself costs nothing: the VPC, subnets, route tables, security groups and IAM are all free. Only the two servers are billed, so each one gets the pricing that matches how it's used. HR runs around the clock, so it's on a one-year Partial Upfront plan; Engineering only works office hours, so it's On-Demand for about 8 hours a day.

ItemCost
Network, security groups, IAM$0.00
HR server (1-year Partial Upfront, always on)$27 upfront + $4.93/month
Engineering server (On-Demand, 8 hours a day)$3.32/month
Semester, about 3.5 months≈ $55.88, 56% of the $100 credit

What we'd change for real

  • One server per tier is a single point of failure. A load balancer and auto scaling would let a second HR server take over.
  • The portal is plain HTTP. An ACM certificate on the load balancer would add HTTPS for free.
  • Tagging depends on people remembering. AWS Config rules could flag anything created without a Department tag.
  • Nobody's watching. CloudTrail and VPC Flow Logs would record every admin action and network connection.

Where my AWS started

This subject is where I earned my AWS Academy Graduate – Cloud Foundations badge, and where I first worked hands-on with AWS: VPCs and subnets, EC2, security groups, IAM policies and the Pricing Calculator. Small as this design is, the lesson stuck with me: put the rules in the structure, so the safe thing is the only thing that can happen.

← Where can I solat Jumaat from here? A whole company in 49 tables →