variable "env" {
  type = string
}

variable "customer_id" {
  type = string
}

variable "cloud_region" {
  type = string
}

variable "logical_region_name" {
  type = string
}

variable "cluster_name" {
  type = string
}

variable "resource_group_name" {
  type = string

  validation {
    condition     = try(trimspace(var.resource_group_name) != "", false)
    error_message = "resource_group_name must be the onboarding-created O11Y AKS resource group."
  }
}

variable "customer_tenant_id" {
  type = string
}

variable "customer_subscription_id" {
  type = string
}

variable "o11y_deployment_multi_tenant_app_client_id" {
  type        = string
  description = "Temporary O11Y deployment multi-tenant app client ID used by auto-deploy and Observability CD to access customer AKS."
}

variable "customer_acr_resource_id" {
  type = string
}

variable "customer_acr_login_server" {
  type = string
}

variable "storage_resource_group_name" {
  type = string

  validation {
    condition     = try(trimspace(var.storage_resource_group_name) != "", false)
    error_message = "storage_resource_group_name must be the onboarding-created O11Y storage resource group."
  }
}

variable "controlplane_aws_account" {
  type = string
}

variable "o11y_global_account" {
  type = string
}

variable "o11y_sns_topic_arn" {
  type = string
}

variable "dns_zone_name" {
  type = string

  validation {
    condition     = try(trimspace(var.dns_zone_name) != "", false)
    error_message = "dns_zone_name must be the customer-hosted Azure DNS zone name for O11Y RS/DS records."
  }
}

variable "dns_zone_resource_group_name" {
  type = string

  validation {
    condition     = try(trimspace(var.dns_zone_resource_group_name) != "", false)
    error_message = "dns_zone_resource_group_name must be the Azure resource group containing the customer-hosted O11Y DNS zone."
  }
}

variable "image_registry" {
  type = string
}

# Image tag for the O11Y regional server.
# This is pinned intentionally; update it only after the customer ACR has the
# matching image.
variable "regional_server_img_tag" {
  type    = string
  default = "2026-05-12-e5a584a06d6f922746fabf068ac0f17be7876c6e"
}

# Image tag for the O11Y data server.
# This is pinned intentionally; update it only after the customer ACR has the
# matching image.
variable "data_server_img_tag" {
  type    = string
  default = "2026-05-12-e5a584a06d6f922746fabf068ac0f17be7876c6e"
}

variable "byoc_tenant_id" {
  type = string
}

variable "api_server_vnet_integration_enabled" {
  type = bool
}

variable "o11y_identity_resource_group" {
  type = string

  validation {
    condition     = try(trimspace(var.o11y_identity_resource_group) != "" && !strcontains(var.o11y_identity_resource_group, "/"), false)
    error_message = "o11y_identity_resource_group must be the Azure resource group name containing all O11Y user-assigned managed identities."
  }
}

variable "o11y_aks_control_plane_identity_name" {
  type = string
}

variable "o11y_aks_kubelet_identity_name" {
  type = string
}

variable "o11y_regional_server_identity_name" {
  type = string
}

variable "o11y_vmbackup_identity_name" {
  type = string
}

variable "o11y_loki_identity_name" {
  type = string
}

variable "o11y_velero_identity_name" {
  type = string
}

variable "o11y_agic_identity_name" {
  type = string
}

variable "network" {
  type = object({
    vnet_cidr      = optional(string, "10.81.0.0/20")
    service_cidr   = optional(string, "172.16.0.0/16")
    dns_service_ip = optional(string, "172.16.0.10")
  })
  default = {}
}

variable "aks" {
  type = object({
    k8s_version                  = optional(string, "1.36.1")
    vm_size                      = optional(string, "Standard_E8as_v7")
    nodepool_size                = optional(number, 3)
    nodepool_autoscaling_enabled = optional(bool, true)
    nodepool_min_size            = optional(number, 3)
    nodepool_max_size            = optional(number, 10)
    authorized_ip_ranges         = optional(list(string), ["0.0.0.0/0"])
    availability_zones           = optional(list(string), ["1"])
  })
  default = {}
}

variable "tags" {
  description = "Customer-defined tags to apply to shoot resources"
  type        = map(string)
  default     = {}
}
