Skip to main content

Infrastructure as Code

Eigenoid manages all cloud infrastructure with Terraform using a producer/consumer model. The producer (platform-actions) provides reusable CI/CD workflows. Each infrastructure repo (consumer) declares what to deploy in a terraflow.yaml file and the pipeline handles the rest.

If you just want to create or change infrastructure, you only need to edit Terraform files and open a PR. The pipeline plans, applies, and promotes automatically.

GCP -- three projects

All GCP infrastructure is spread across three independent projects (ADR-0009):

EnvironmentProjectPurpose
deveigenoid-devDevelopment, auto-deploy on merge
qaeigenoid-qaStaging, approval gates
prdeigenoid-prdProduction, org-level services, Artifact Registry

Authentication

GitHub Actions authenticates with GCP via Workload Identity Federation (OIDC, no stored secrets):

ResourceValue
WIF Poolgithub
OIDC Providereigenoid
Terraform CI SAterraform-ci@eigenoid-{env}.iam.gserviceaccount.com
Bootstrap SAplatform-bootstrap@eigenoid-{env}.iam.gserviceaccount.com

State buckets

Each stack has three Terraform state buckets (one per environment), created automatically when the repo is created (ADR-0012):

eigenoid-2cea55-{stack}-tfstate-{env}

Infrastructure stacks

StackRepoWhat it manages
Foundationiac-foundationWIF pools/providers, service accounts, GCP API enablement
Platformiac-platformsafe-settings Cloud Run, Docker Artifact Registry
Distributioniac-distributionPython Artifact Registry repos for eigenoid + eigenoid-sample
Accessiac-accessCloud SQL, Cloud Run, Pub/Sub, Scheduler for access management
Templateiac-templatePre-configured template for bootstrapping new stacks

The producer that powers all of these is platform-actions -- reusable workflows + centralized environment config.

Change flow

Developer → PR in consumer → Automatic plan (dev)

Review + /terraflow apply → Apply in dev

Merge → workflow_dispatch promote → Apply in qa → prd
  1. A PR in a consumer triggers an automatic plan against the default environment (dev).
  2. The bot posts the plan output as a comment on the PR.
  3. An authorized member comments /terraflow apply to execute the apply.
  4. After merge, you can promote to higher environments (qa, prd) via workflow_dispatch.

Pages in this section