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; one explicit route per app endpoint, no catch-all; every route throttled
API LambdaComputeNo VPC attachment
Authorizer LambdaComputeValidates 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 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
CloudWatchObservabilityLogs and metrics via Lambda Powertools
AWS Budgets alarmCostAccount spend alerts: a daily Bedrock budget and a monthly account budget

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