GCP Infrastructure (Terraform) β
All GCP infrastructure is managed by Terraform in the infra/ directory at the repo root.
Structure β
infra/
βββ main.tf # Module wiring
βββ variables.tf # Shared variables and locals
βββ outputs.tf # Root-level outputs
βββ iam.tf # Project-level IAM (engineering groups)
βββ terraform.tf # Provider config (google, google-beta, 1password, grafana)
βββ terraform.tfvars # Local variable overrides (gitignored)
βββ artifacts/ # Artifact Registry (multi-region Docker repo + cleanup)
βββ firebase/ # Firebase project, web/iOS/Android apps, Identity Platform
βββ github-actions/ # Workload Identity Federation for keyless CI/CD
βββ grafana/ # Grafana Cloud dashboards, alerting, Slack notifications
βββ play-store/ # Google Play Store service account for EAS Submit
βββ state-bucket/ # Terraform state bucket IAM
βββ vapi/ # GCS buckets + service account for Voice APIWorkspaces β
Terraform workspaces map to GCP projects:
| Workspace | GCP Project |
|---|---|
dev | tell-ia-dev |
staging | tell-ia-staging |
production | tell-ia-production |
All resource naming is environment-suffixed automatically (e.g., tellia-play-store-dev).
Getting Started β
Prerequisites β
- Terraform >= 1.0
- GCP CLI authenticated:
gcloud auth application-default login OP_SERVICE_ACCOUNT_TOKENenv var set (1Password provider, required even forterraform init)
Commands β
cd infra
terraform init # Initialize (registers modules + providers)
terraform workspace select dev # Switch environment
terraform plan # Preview changes
terraform apply # Apply changesModules β
artifacts/ β
Artifact Registry with multi-region Docker repo and automated cleanup policies. Stores CI/CD images including the Firebase Auth emulator.
firebase/ β
Firebase project setup, web/iOS/Android app registration, and Identity Platform (Firebase Auth) config with email/password sign-in. Stores Firebase config values in 1Password.
github-actions/ β
Workload Identity Federation (OIDC) for keyless GitHub Actions authentication with GCP. No service account keys needed β uses OIDC tokens. Config stored in 1Password.
grafana/ β
Grafana Cloud dashboards and alerting rules for backend monitoring. Environment-specific alert thresholds with Slack notifications.
play-store/ β
Google Play Store API access for automated app submissions via EAS Submit. Creates a GCP service account, generates a JSON key, and stores it in 1Password.
IMPORTANT
After terraform apply, the service account must be manually invited in Google Play Console > Users and permissions with release permissions. See Mobile Build & Submit for the full workflow.
vapi/ β
GCS buckets and service accounts for Voice API integrations. Includes HMAC keys for S3-compatible access.
state-bucket/ β
IAM configuration for the Terraform state GCS bucket.
Secrets Management β
All secrets are stored in 1Password via the Terraform 1Password provider β not in tfvars, CI secrets, or the repo. Each module that produces credentials creates a 1Password item with:
- The credential values
- Setup instructions
- Environment and domain tags for easy filtering
IAM Structure β
Project-level IAM is defined in iam.tf:
| Group | Dev | Staging | Production |
|---|---|---|---|
engineering-leads@tell-ia.com | Owner | Owner | Owner |
engineering@tell-ia.com | Owner | Viewer | Viewer |
engineering-contractors@ | Owner | No access | No access |
CI/CD β
- Plan: Runs on PRs to main/staging/production (
.github/workflows/terraform-plan.yml) - Apply: Runs on push to main/staging/production (
.github/workflows/terraform-apply.yml)