Part 4: Infrastructure as Code with Pulumi
Provision and manage Aevum's multi-region knowledge infrastructure using modern IaC patterns.
Aevum Encyclopedia relies on a distributed, low-latency infrastructure to serve 2.4M+ articles across 140 languages. This guide details how to provision the underlying cloud resources using Pulumi, enabling type-safe infrastructure, familiar programming languages, and seamless GitOps workflows.
Prerequisites
- Pulumi CLI v3.110+ (
curl -fsSL https://get.pulumi.com | sh) - Node.js 18+ or Python 3.10+
- Cloud provider credentials (AWS/Azure/GCP) with
IAMFullAccessscope - Aevum Organization access token for private registry pulls
Initialize Project
Clone the infrastructure repository and scaffold a new stack:
The scaffolded project includes three primary modules:
./network/— VPC, Transit Gateway, NAT Gateways./compute/— ECS/EKS clusters, Lambda@Edge, AI GPU nodes./data/— Neptune/Neo4j graphs, S3/GCS artifact storage, Redis cache
Core Components
Aevum's knowledge graph requires specialized storage and compute. Below is the TypeScript definition for the primary graph cluster and AI routing layer:
aiRouter requires GPU-backed instances in regions supporting g5.xlarge or p4d.24xlarge. Fallback to CPU inference will degrade semantic search latency by ~400ms.
Deploy & Validate
Preview changes before applying. Pulumi renders a diff similar to git diff for infrastructure:
Post-deployment validation runs automated health checks against the knowledge graph and AI endpoints. The CLI outputs stack exports including the CDN distribution ID, graph cluster ARN, and monitoring dashboard URLs.
Environment Configuration
Sensitive values are encrypted using Pulumi's default KMS-backed encryption. Override defaults via config files:
Scaling Strategies
Aevum automatically scales based on query load and language request distribution:
- Horizontal Pod Autoscaling (HPA) — Triggers at 70% CPU/RAM utilization across inference pods
- Read Replica Scaling — Adds graph replicas when
graph.read_latency_p99exceeds 120ms - Edge Caching — CloudFront/GCP CDN caches static article renders with
Cache-Control: public, max-age=86400
Use pulumi config set scaling:enabled true to activate auto-scaling policies. Monitor capacity via the exported grafanaDashboardUrl.