Infrastructure
Two AWS environments, QA and Prod, provisioned by environment-agnostic Terraform modules composed per environment.
Environments
Expand to see both AWS environments and the local environment:
QA deploys automatically on merge to main. Prod is gated behind a GitHub Environment
manual-approval rule. Both environments are structurally identical; QA is paused more
aggressively to keep idle cost down. Local development is a third environment running
Postgres + pgvector in Docker — see the local guide.
Per-environment resources
Expand to see the resources deployed in each environment (QA shown):
Ingestion deployment
Expand to see ingestion, which runs as a local Python script during development or as a one-off Lambda invocation in AWS:
Lambda runs outside the VPC and reaches Aurora Serverless v2 through the RDS Data API, an HTTPS endpoint that needs no NAT gateway (~$32/month saved) and no VPC attachment on the Lambda. The VPC exists solely to host Aurora’s private subnets and security group.
AWS Resources per environment
| Resource | Service | Notes |
|---|---|---|
| CloudFront distribution + S3 bucket | Edge | Serves the React SPA |
| API Gateway HTTP API | Compute | Route API requests to Lambda; one explicit route per app endpoint, no catch-all; every route throttled |
| API Lambda | Compute | No VPC attachment |
| Authorizer Lambda | Compute | Validates bearer tokens on POST /query (RAG009); reserved concurrency 5, so at most 5 key-quota decrements run at once and callers beyond that get a 500 (a flood, or slow Data API calls such as an Aurora resume); no VPC attachment |
| Ingestion Lambda | Compute | One-time corpus load; triggered manually |
| Bedrock | AI | Embeddings and generation** |
| Aurora Serverless v2 cluster | Data | pgvector; 0-ACU auto-pause; in VPC |
| Secrets Manager secret | Security | DB credentials |
| IAM execution role | Security | Least-privilege: Bedrock, rds-data, Secrets Manager |
| CloudWatch | Observability | Logs and metrics via Lambda Powertools |
| AWS Budgets alarm | Cost | Account spend alerts: a daily Bedrock budget and a monthly account budget |
** AWS-managed API: no VPC endpoint or provisioned resource needed.
© 2026 Benjamin Arunski