How 100-hours-a-week/ktb4-10th-infra works
KGB V2 Infrastructure is a Terraform-managed AWS platform for moving the KGuideBook service from a single-EC2 V1 toward a separate V2 VPC. The documented target workflow is user traffic through CloudFront to frontend storage or the ALB, then ECS backend tasks and private RDS; app-subnet egress uses per-AZ NAT instances. The README also describes IAM/SSM access, monitoring, Redis, AI, and other infrastructure modules. The target architecture includes planned or reused resources: the README says ALB and monitoring are pending, and S3/CloudFront are to be reused. No source excerpts were provided, so relationships below rely on README documentation rather than inspected Terraform calls.
Main entry points: prod/main.tf Production root · nat/main.tf NAT instances · backend/main.tf Backend service · cloudfront.tf CloudFront
Components 20
Environment roots
- Production root
prod/main.tf
Network and access
- VPC networking
modules/network/main.tf - Security groups
modules/security/main.tf - IAM roles
modules/iam/main.tf - NAT instances
modules/nat/main.tf
Application compute
- Application load balancer
modules/alb/main.tf - ECS cluster hosts
modules/ecs/main.tf - Backend service
modules/backend/main.tf
Data and services
- RDS MySQL
modules/rds/main.tf - Redis
modules/redis/main.tf - AI infrastructure
modules/ai/main.tf
Operations and delivery
- CloudFront
prod/cloudfront.tf - Frontend storage
prod/storage.tf - Container registry
modules/registry/main.tf - Monitoring host
modules/monitoring/main.tf - Metrics exporters
modules/exporters/main.tf
Other components
- Users
- Internet
- RunPod API
- Developer
Connections 19
- Users → CloudFront: request content
README.md - CloudFront → Frontend storage: serve frontend
README.md - CloudFront → Application load balancer: forward API
README.md - Application load balancer → Backend service: route requests
README.md - Backend service → RDS MySQL: access database
README.md - VPC networking → NAT instances: route app egress
README.md - NAT instances → Internet: NAT traffic
README.md - Backend service → RunPod API: call API
README.md - Developer → NAT instances: SSM tunnel
README.md - NAT instances → RDS MySQL: forward DB port
README.md - Production root → VPC networking: configures
README.md - Production root → Security groups: configures
README.md - Production root → IAM roles: configures
README.md - Production root → NAT instances: configures
README.md - Production root → ECS cluster hosts: configures
README.md - Production root → Backend service: configures
README.md - Production root → RDS MySQL: configures
README.md - Production root → Application load balancer: plans
README.md - Production root → Monitoring host: plans
README.md