# azure-full-cell — AKS shared-standard cell with Entra-bound identity.
#
# AKS + Azure DB for Postgres + Azure Cache for Redis + ADLS +
# Workload Identity (Entra-bound) + the standard observability + mesh
# + edge stack.

name: alphaswarm-azure-full-cell
slug: azure-full-cell
module_kind: composite
description: |
  Full AlphaSwarm cell on Azure. AKS + Azure DB for Postgres + Azure
  Cache for Redis + ADLS + Workload Identity (Entra-bound) + the
  standard observability + mesh + edge stack. Pairs naturally with
  the Entra-tenant subscription model.

cloud_provider: azure
environment: live

provider:
  kind: azure
  region: eastus

backend:
  kind: azurerm
  config:
    resource_group_name: alphaswarm-tfstate
    storage_account_name: alphaswarmtfstate
    container_name: tfstate
    key: alphaswarm_platform/cells/azure-shared-std/terraform.tfstate

variables:
  - name: subscription_id
    type: string
    description: Required — Azure subscription id hosting the cell.
  - name: tenant_id
    type: string
    description: Required — Entra tenant id for Workload Identity Federation.
  - name: region
    type: string
    default: eastus
  - name: cell_name
    type: string
    default: azure-shared-std-eus
  - name: cell_replicas
    type: number
    default: 3
  - name: tier
    type: string
    default: shared-std
  - name: ingress_host
    type: string
    default: aqp.azure-shared-std-eus.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: azure
      environment: live
  - name: kubernetes
    source: ../../modules/kubernetes
    variables:
      organization_slug: alphaswarm
      workspace_slug: "${var.cell_name}"
  - name: storage
    source: ../../modules/storage
    variables:
      cloud_provider: azure
      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:
  azurerm:
    source: hashicorp/azurerm
    version: ~> 4.0
  azuread:
    source: hashicorp/azuread
    version: ~> 3.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: azure-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: "$1300-$2500"
