How epruitt/vpcwebsitehosting works
This repository defines secure AWS hosting for the Omnifood static website, with Terraform infrastructure, observability, and a GitHub Actions OIDC deployment foundation. The user-facing path is browser traffic through an Application Load Balancer to a private EC2 web server; website assets are stored in S3 and synced to the instance at boot. CloudWatch and SNS provide monitoring and alerts. The README documents several relationships and capabilities; most Terraform source was not included in the excerpts, so edges reflect documented behavior rather than inspected calls.
Main entry points: c5-private-ec2.tf Private EC2 server · alb.tf Application Load Balancer · s3-website-assets.tf Website assets bucket · c6-monitoring.tf Alarms and dashboard
Components 16
Hosting infrastructure
- Application Load Balancer
vpcWebsiteHosting/modules/vpc/alb.tf - VPC and subnets
vpcWebsiteHosting/modules/vpc/main.tf - Private EC2 server
vpcWebsiteHosting/c5-private-ec2.tf - EC2 IAM role
vpcWebsiteHosting/modules/vpc/ec2-iam-role.tf
Website delivery
- Website assets bucket
vpcWebsiteHosting/modules/vpc/s3-website-assets.tf - Asset uploader
vpcWebsiteHosting/modules/vpc/website-content.tf - Omnifood site
vpcWebsiteHosting/modules/vpc/website/index.html - Site interactions
vpcWebsiteHosting/modules/vpc/website/js/script.js
Monitoring and alerts
- CloudWatch agent config
vpcWebsiteHosting/agent-config.json - Alarms and dashboard
vpcWebsiteHosting/c6-monitoring.tf - SNS email alerts
vpcWebsiteHosting/c6-monitoring.tf
Deployment access
- GitHub Actions
.github/workflows/terraform-deploy.yml - GitHub OIDC roles
vpcWebsiteHosting-bootstrap/oidc.tf
Other components
- Website visitor
- AWS
- Operator
Connections 15
- Website visitor → Application Load Balancer: requests site
readme.md - Application Load Balancer → Private EC2 server: forwards traffic
readme.md - VPC and subnets → Private EC2 server: hosts privately
readme.md - Website assets bucket → Private EC2 server: syncs at boot
readme.md - Asset uploader → Website assets bucket: uploads assets
- EC2 IAM role → Website assets bucket: scoped access
readme.md - Omnifood site → Site interactions: uses interactions
- Private EC2 server → CloudWatch agent config: uses config
readme.md - Private EC2 server → Alarms and dashboard: provides metrics
readme.md - Application Load Balancer → Alarms and dashboard: provides metrics
readme.md - Alarms and dashboard → SNS email alerts: sends alerts
readme.md - SNS email alerts → Operator: emails alerts
readme.md - GitHub Actions → GitHub OIDC roles: assumes roles
readme.md - GitHub OIDC roles → AWS: authorizes deploys
readme.md - Operator → Private EC2 server: connects via SSM
readme.md