variable "subscription_id" {
  description = "Azure subscription ID"
  type        = string
  default     = "77677a80-2dea-493d-9867-f1c961b80fb3"
}

variable "resource_group_name" {
  description = "Name of the existing resource group"
  type        = string
  default     = "trusted_ai_demo_rg"
}

variable "location" {
  description = "Azure region for resources"
  type        = string
  default     = "germanywestcentral"
}

variable "aks_cluster_name" {
  description = "Name of the existing AKS cluster"
  type        = string
  default     = "trai_k8s_cluster"
}

variable "app_name" {
  description = "Name of the application"
  type        = string
  default     = "laravel-app"
}

variable "app_namespace" {
  description = "Kubernetes namespace for the application"
  type        = string
  default     = "laravel-app"
}

variable "docker_image" {
  description = "Docker image for the Laravel application"
  type        = string
  # Format: <registry>/<image>:<tag>
  # Example: "myregistry.azurecr.io/laravel-app:latest"
}

variable "app_replicas" {
  description = "Number of application replicas"
  type        = number
  default     = 2
}

variable "app_resources_requests_cpu" {
  description = "CPU resource requests for application pods"
  type        = string
  default     = "100m"
}

variable "app_resources_requests_memory" {
  description = "Memory resource requests for application pods"
  type        = string
  default     = "256Mi"
}

variable "app_resources_limits_cpu" {
  description = "CPU resource limits for application pods"
  type        = string
  default     = "500m"
}

variable "app_resources_limits_memory" {
  description = "Memory resource limits for application pods"
  type        = string
  default     = "512Mi"
}

# PostgreSQL Variables
variable "postgresql_admin_username" {
  description = "Administrator username for PostgreSQL"
  type        = string
  default     = "pgadmin"
}

variable "postgresql_admin_password" {
  description = "Administrator password for PostgreSQL"
  type        = string
  sensitive   = true
}

variable "postgresql_sku_name" {
  description = "SKU name for PostgreSQL (e.g., B_Standard_B1ms, GP_Standard_D2s_v3)"
  type        = string
  default     = "B_Standard_B1ms"
}

variable "postgresql_storage_mb" {
  description = "Storage size in MB for PostgreSQL"
  type        = number
  default     = 32768 # 32 GB
}

variable "postgresql_version" {
  description = "PostgreSQL version"
  type        = string
  default     = "16"
}

variable "postgresql_backup_retention_days" {
  description = "Backup retention days for PostgreSQL"
  type        = number
  default     = 7
}

# Laravel Application Variables
variable "app_key" {
  description = "Laravel application key (base64 encoded)"
  type        = string
  sensitive   = true
}

variable "app_env" {
  description = "Laravel application environment"
  type        = string
  default     = "production"
}

variable "app_debug" {
  description = "Enable Laravel debug mode"
  type        = bool
  default     = false
}

variable "app_url" {
  description = "Laravel application URL"
  type        = string
  # Will be set based on ingress if not provided
  default = ""
}

# Ingress Variables
variable "ingress_enabled" {
  description = "Enable ingress controller"
  type        = bool
  default     = true
}

variable "ingress_host" {
  description = "Hostname for the ingress (leave empty for IP-based access)"
  type        = string
  default     = ""
}

variable "ssl_enabled" {
  description = "Enable SSL/TLS (requires cert-manager)"
  type        = bool
  default     = false
}

variable "ssl_issuer_email" {
  description = "Email for Let's Encrypt certificate issuer"
  type        = string
  default     = ""
}

# Database Restore Variables
variable "db_restore_enabled" {
  description = "Enable database restore job on deployment"
  type        = bool
  default     = false
}

variable "db_backup_file_path" {
  description = "Path to the database backup file (local path that will be uploaded)"
  type        = string
  default     = "../backups/backup_backend_20251203_101741.dump"
}

# Alert Variables
variable "alert_email_address" {
  description = "Email address for alert notifications"
  type        = string
  sensitive   = true
}
