# aws-cell-shared-premium — shared-std + dedicated node group + reserved capacity.
#
# Inherits the shared-std composition and adds a premium tier — a
# dedicated Karpenter node pool with reserved capacity, larger PDB
# minAvailable, and tighter HPA targets.

name: alphaswarm-aws-cell-shared-premium
slug: aws-cell-shared-premium
module_kind: composite
description: |
  AWS shared-premium cell. shared-std composition + a dedicated
  Karpenter node pool reserved for premium tenants, with raised
  base-workload replicas, larger PDB minAvailable, and Reserved
  Instance / Savings Plan-friendly capacity allocation.

cloud_provider: aws
environment: live

provider:
  kind: aws
  region: us-east-1

backend:
  kind: s3
  config:
    bucket: alphaswarm-tfstate
    key: alphaswarm_platform/cells/aws-shared-premium/terraform.tfstate
    region: us-east-1
    encrypt: true
    use_lockfile: true

variables:
  - name: region
    type: string
    default: us-east-1
  - name: cell_name
    type: string
    default: shared-premium-us-east-1a
  - name: cell_replicas
    type: number
    default: 4
    description: Premium baseline; HPA min raised correspondingly.
  - name: tier
    type: string
    default: shared-premium
  - name: ingress_host
    type: string
    default: aqp.shared-premium-us-east-1a.alpha-swarm.ai
  - name: dedicated_node_pool
    type: string
    default: alphaswarm-premium
  - name: reserved_capacity_count
    type: number
    default: 4
    description: Reserved instance count for the premium node pool.
  - 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: aws
      environment: live
  - name: kubernetes
    source: ../../modules/kubernetes
    variables:
      organization_slug: alphaswarm
      workspace_slug: "${var.cell_name}"
  - name: storage
    source: ../../modules/storage
    variables:
      cloud_provider: aws
      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}"
      dedicated_node_pool: "${var.dedicated_node_pool}"
      reserved_capacity_count: "${var.reserved_capacity_count}"
  - 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:
  aws:
    source: hashicorp/aws
    version: ~> 5.50
  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: aws-cell-shared-premium
  alphaswarm.io/template-kind: composite
  alphaswarm.io/cell-tier: shared-premium
  alphaswarm.io/composition: networking + kubernetes + storage + cell (premium) + observability_stack + mesh_identity + edge_stack
  alphaswarm.io/target-cost-monthly: "$3500-$6000"
