Skip to content

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

ResourceServiceNotes
CloudFront distribution + S3 bucketEdgeServes the React SPA
API Gateway HTTP APIComputeRoute API requests to Lambda; throttle /query; no throttle on /healthz
API LambdaComputeNo VPC attachment
Authorizer LambdaComputeValidates bearer tokens on POST /query (RAG009); no VPC attachment
Ingestion LambdaComputeOne-time corpus load; triggered manually
BedrockAIEmbeddings and generation**
Aurora Serverless v2 clusterDatapgvector; 0-ACU auto-pause; in VPC
Secrets Manager secretSecurityDB credentials
IAM execution roleSecurityLeast-privilege: Bedrock, rds-data, Secrets Manager
CloudWatch + X-RayObservabilityLogs, metrics, and traces via Lambda Powertools
AWS Budgets alarmCostPer-environment spend alert

** AWS-managed API: no VPC endpoint or provisioned resource needed.