AWS Cloud Project
A multi-AZ AWS deployment hosting a public web application across separate public and private tiers, backed by an Application Load Balancer and auto-scaled EC2 instances.
Fig 1. Two-tier cloud architecture diagram
When designing the Virtual Private Cloud (VPC), subnet sizing was planned to balance address capacity and isolation. We allocated subnets across multiple availability zones while leaving address space for future expansion.
AWS reserves five IP addresses per subnet. Subnet allocation was determined by tier function:
- Public subnets: Kept compact to minimize exposure.
- Application (EC2) private subnets: Allocated the largest blocks to accommodate horizontal scaling by the Auto Scaling Group.
- Database private subnets: Sized for fixed database instances that scale vertically rather than horizontally.
To ensure fault tolerance and handle traffic spikes, the web tier is decoupled from the compute instances. We deployed an Application Load Balancer (ALB) across two public subnets to distribute incoming HTTP and HTTPS traffic to private application instances.
The backend EC2 instances run in an Auto Scaling Group (ASG). Using target tracking policies, the infrastructure provisions new instances when request volume increases and terminates them as traffic normalizes. A User Data script configures the PHP runtime and synchronizes application files from S3 upon instance launch.
Fig 2. User Data script for automated instance configuration
To provide a clean domain name instead of the default AWS Load
Balancer endpoint, I configured Cloudflare DNS with a CNAME
record pointing egl211.rirori.xyz to the load
balancer.
This configuration routes incoming traffic through Cloudflare's edge network for SSL termination, DDoS protection, and HTTP proxying before reaching the internal balancer.
We used Amazon S3 for durable object storage to handle user file uploads. Decoupling storage from the compute instances required handling cross-origin security headers.
Because the web application is served from our custom Cloudflare
domain, direct uploads to the AWS S3 endpoint were initially
blocked by browser CORS checks. I resolved this by adding a
Cross-Origin Resource Sharing policy on the S3 bucket that
permits PUT and POST requests from
https://egl211.rirori.xyz.
I paired this with a bucket policy on
grp2-prod-webapp-uploads-s3, enforcing least
privilege by scoping permissions to s3:PutObject
and s3:GetObject.
Figs 3–4. Securing S3 with strict bucket & CORS policies
To secure the network boundary, I restricted the load balancer's security group to only accept traffic from Cloudflare's verified IP ranges. This blocks direct public access to the AWS infrastructure.
For sensitive upload and administrative endpoints, I configured Cloudflare Zero Trust. The identity-aware proxy requires users to authenticate against an authorized GitHub organization before requests reach the load balancer.
Figs 5–6. Custom DNS & identity-aware proxy configuration
Application and database servers reside in private subnets without public IP addresses. To enable administrative access, we deployed a Bastion host in a public subnet to act as a jump box.
To avoid storing private keys on the Bastion host, I used SSH
agent forwarding (ssh -A). This forwards
authentication from the local machine through the Bastion to
the private instances without exposing the private key. We also
configured Fail2ban on the Bastion to block repeated failed
login attempts.
Fig 7. Agent forwarding through the Bastion host
Serving as project lead required coordinating infrastructure planning, deployment steps, and team documentation.
Automating instance provisioning through the load balancer and User Data scripts highlighted the importance of consistent, reproducible environments.
One challenge was session management. Because the PHP application originally stored session files locally on disk, users lost their session whenever the load balancer routed a subsequent request to another instance. This demonstrated that horizontal scaling requires stateless web tiers. In future deployments, session state should be externalized to a shared store such as Redis (Amazon ElastiCache) or an RDS database.
Beyond architecture, managing team deliverables reinforced the value of structured documentation. Standardizing format, figure references, and review cycles was essential to delivering a coherent final report.