# gcp-full-cell — GKE shared-standard cell.
#
# GKE Autopilot + Cloud SQL + Memorystore + GCS + Workload Identity +
# the standard observability + mesh + edge stack.

name: alphaswarm-gcp-full-cell
slug: gcp-full-cell
module_kind: composite
description: |
  Full AlphaSwarm cell on GCP. GKE Autopilot + Cloud SQL (Postgres) +
  Memorystore (Redis) + GCS + Workload Identity Federation + the
  standard observability stack + mesh-identity + edge stack.
  Multi-tenant via namespace isolation; cell tier `shared-std`.

cloud_provider: gcp
environment: live

provider:
  kind: gcp
  region: us-central1

backend:
  kind: gcs
  config:
    bucket: alphaswarm-tfstate-gcp
    prefix: alphaswarm_platform/cells/gcp-shared-std

variables:
  - name: project_id
    type: string
    description: Required — GCP project id hosting the cell.
  - name: region
    type: string
    default: us-central1
  - name: cell_name
    type: string
    default: gcp-shared-std-uc1
  - name: cell_replicas
    type: number
    default: 3
  - name: tier
    type: string
    default: shared-std
  - name: ingress_host
    type: string
    default: aqp.gcp-shared-std-uc1.alpha-swarm.ai
  - name: pomerium_authority
    type: string
    default: manage.alpha-swarm.ai
  - name: entra_idp_url
    type: string
    default: ""
    sensitive: true

modules:
  - name: networking
    source: ../../modules/networking
    variables:
      cloud_provider: gcp
      environment: live
  - name: kubernetes
    source: ../../modules/kubernetes
    variables:
      organization_slug: alphaswarm
      workspace_slug: "${var.cell_name}"
  - name: storage
    source: ../../modules/storage
    variables:
      cloud_provider: gcp
      environment: live
  - name: cell
    source: ../../modules/cell
    variables:
      cell_name: "${var.cell_name}"
      replicas: "${var.cell_replicas}"
      ingress_host: "${var.ingress_host}"
      tier: "${var.tier}"
  - name: observability
    source: ../../modules/observability_stack
  - name: mesh
    source: ../../modules/mesh_identity
    variables:
      pomerium_authority: "${var.pomerium_authority}"
      entra_idp_url: "${var.entra_idp_url}"
      cell_name: "${var.cell_name}"
  - name: edge
    source: ../../modules/edge_stack
    variables:
      cell_name: "${var.cell_name}"
      public_hostname: "${var.ingress_host}"

required_providers:
  google:
    source: hashicorp/google
    version: ~> 6.0
  kubernetes:
    source: hashicorp/kubernetes
    version: ~> 2.30
  helm:
    source: hashicorp/helm
    version: ~> 2.15
  cloudflare:
    source: cloudflare/cloudflare
    version: ~> 5.6

annotations:
  alphaswarm.io/template-name: gcp-full-cell
  alphaswarm.io/template-kind: composite
  alphaswarm.io/cell-tier: shared-std
  alphaswarm.io/composition: networking + kubernetes + storage + cell + observability_stack + mesh_identity + edge_stack
  alphaswarm.io/target-cost-monthly: "$1100-$2200"
