Alethia Labs
Infrastructure Templates

Infrastructure Templates Overview

Terraform modules that Runner uses to provision infrastructure across AWS, GCP, and Azure.

Infrastructure Templates

Runner provisions infrastructure using pre-built Terraform modules. These templates are embedded in the Docker image during the release build and cover all supported resource types across three providers.

Template Categories

CategoryPathPurpose
AWS specinfra/templates/spec/aws/User infrastructure on AWS
GCP specinfra/templates/spec/gcp/User infrastructure on GCP
Azure specinfra/templates/spec/azure/User infrastructure on Azure
Runnerinfra/templates/runner/aws/Runner (worker) infrastructure
ArgoCDinfra/templates/argocd/ArgoCD applications and components

Template Staging (Docker Build)

During the Runner release pipeline, templates are copied into the Docker build context:

infra/templates/spec/aws     → apps/runner/spec-templates/aws
infra/templates/spec/gcp     → apps/runner/spec-templates/gcp
infra/templates/spec/azure   → apps/runner/spec-templates/azure
infra/templates/runner       → apps/runner/runner-templates
infra/templates/argocd       → apps/runner/argocd-templates

Variable Generation

When executing a job, Runner generates terraform.tfvars from the spec's config snapshot. The provisioner in packages/core/provisioner/ maps each spec component to specific Terraform variables. See Cloud Provider Abstraction for the mapping layer.

Terraform State

State for all templates is stored in Supabase S3 with path structure:

{zone}/{project}/{stage}/{region}/terraform.tfstate

On this page