This project represents a fully realized, Senior-level cloud architecture designed to host static frontend applications with maximum performance, zero-server maintenance, and strict security compliance.
Moving beyond standard S3 hosting, this platform leverages a global Content Delivery Network (CDN) for edge caching, Terraform for Infrastructure as Code (IaC), Edge Compute for injecting military-grade security headers, and an automated continuous deployment pipeline.
flowchart TD
User([End User]) -->|HTTPS| CF[CloudFront Distribution \n Edge CDN]
subgraph AWS Cloud
CF -->|Origin Fetch| S3[Amazon S3 Bucket \n Static Assets]
CF -.->|Viewer Response| CFF[CloudFront Function \n Security Headers]
S3 -.->|Access Logs| Logs[(S3 Logs Bucket)]
end
subgraph CI/CD Pipeline
GH[GitHub Actions] -.->|1. Sync Files| S3
GH -.->|2. Invalidate Cache| CF
end
subgraph FinOps
CW[CloudWatch Alarm] -.->|Monitors Cost| SNS[SNS Alert]
end
- Storage: Amazon S3 (Provides 99.999999999% data durability with highly available object storage).
- Edge Delivery: Amazon CloudFront (Caches assets globally, reducing Time to First Byte to single-digit milliseconds).
- Encryption: AWS Certificate Manager (ACM) (Enforces strict SSL/TLS encryption for data in transit).
- Infrastructure as Code: Terraform (Provides a declarative, idempotent configuration of all cloud resources).
Instead of running a traditional web server to handle HTTP headers, this architecture utilizes CloudFront Functions (Serverless Edge Compute).
A custom JavaScript function intercepts every outbound response at the edge node closest to the user and dynamically injects:
Strict-Transport-Security(HSTS)X-Content-Type-Options(nosniff)X-Frame-Options(DENY)X-XSS-Protection(1; mode=block)
Cost optimization is built directly into the architecture:
- S3 Lifecycle Rules: Automatically purges server access logs after 30 days to prevent infinite storage bloat.
- CloudWatch Billing Alarms: Programmatically monitors
EstimatedChargesinus-east-1and triggers an SNS alert if costs exceed $1.00. - CloudFront Pricing Class: Locked to
PriceClass_100to maximize AWS Free Tier utilization.
The deployment process is 100% automated using GitHub Actions:
- Trigger: Developer pushes code to the
mainbranch. - Authenticate: Action securely assumes AWS credentials using GitHub Secrets (safeguarding the repository from leaked keys).
- Sync: Runs
aws s3 sync --deleteto instantly update the S3 origin. - Invalidate: Triggers
aws cloudfront create-invalidationto immediately purge the global edge cache.
Deploying the infrastructure from scratch takes less than 3 minutes.
# 1. Initialize Terraform
cd terraform
terraform init
# 2. Preview the Infrastructure
terraform plan
# 3. Deploy to AWS
terraform apply -auto-approveBuilding this platform solidified core cloud engineering principles including the transition from "ClickOps" (AWS Console) to automated scripts (Python/Boto3), and finally to declarative Infrastructure as Code (Terraform). It demonstrates a complete understanding of the modern DevOps lifecycle.
