variable "region" {
  description = "AWS region. qubera-docs already lives in us-east-1."
  type        = string
  default     = "us-east-1"
}

variable "input_bucket" {
  description = "Existing bucket holding source PDFs under the input prefix."
  type        = string
  default     = "qubera-docs"
}

variable "output_bucket" {
  description = "Bucket created here for extraction artifacts."
  type        = string
  default     = "qubera-extracts"
}

variable "input_prefix" {
  description = "Key prefix under which inbound PDFs land (and the event filter)."
  type        = string
  default     = "inbound/"
}

variable "github_repo" {
  description = "owner/repo permitted to assume the CI role via GitHub OIDC."
  type        = string
  default     = "xmandeng/quber"
}

variable "image_tag" {
  description = "ECR image tag the initial task definition points at."
  type        = string
  default     = "latest"
}

variable "task_cpu" {
  description = "Fargate task CPU units (CPU-only job)."
  type        = number
  default     = 2048
}

variable "task_memory" {
  description = "Fargate task memory (MiB)."
  type        = number
  default     = 8192
}

variable "log_retention_days" {
  description = "CloudWatch log retention. Short for now; revisit at go-live."
  type        = number
  default     = 14
}

variable "runpod_endpoint_id" {
  description = "RunPod serverless endpoint id for the docling parse worker (created by runpod/create_endpoint.py)"
  type        = string
}

variable "deadline_minutes" {
  description = "Minutes after parse submission before the join Lambda verifies the completion marker. Must cover the worst observed path: a worker freshly placed on a new host pulls the 10GB image (~11 min measured) before the parse runs (up to the 10-minute execution timeout)."
  type        = number
  default     = 25
}

variable "alert_email" {
  description = "Email address subscribed to the hold-alerts SNS topic; empty disables the subscription"
  type        = string
  default     = ""
}

# ---------------------------------------------------------------------------
# Playground database
# ---------------------------------------------------------------------------
variable "operator_cidr" {
  description = "The developer host's address (a /32) admitted to the playground database for the schema restore and for running the local playground against RDS. Set in terraform.tfvars; change it when the home IP changes."
  type        = string
}

variable "db_initial_password" {
  description = "Throwaway master password used only at instance creation; rotate to the /quber/POSTGRES_PASSWORD value out of band immediately after the first apply (see rds.tf). Pass a random value as TF_VAR_db_initial_password on that first apply; the default is never what the instance runs with, because drift on the password is ignored."
  type        = string
  sensitive   = true
  default     = "rotated-out-of-band-after-creation"
}

variable "db_engine_version" {
  description = "RDS PostgreSQL engine version for the playground database."
  type        = string
  default     = "17.6"
}

variable "db_instance_class" {
  description = "RDS instance class for the playground database."
  type        = string
  default     = "db.t4g.micro"
}

variable "db_allocated_storage" {
  description = "Playground database storage in GB (gp3)."
  type        = number
  default     = 20
}

variable "db_name" {
  description = "Database name; matches the local playground's POSTGRES_DB so the app's connection settings change only host and password."
  type        = string
  default     = "quber_rag"
}

variable "db_username" {
  description = "Master username; matches the local playground's POSTGRES_USER."
  type        = string
  default     = "quber"
}

# ---------------------------------------------------------------------------
# Playground service
# ---------------------------------------------------------------------------
variable "playground_hostname" {
  description = "The playground's public hostname; a record in an existing hosted zone."
  type        = string
  default     = "playground.qubera.ai"
}

variable "playground_zone" {
  description = "The existing Route 53 hosted zone the hostname is created in."
  type        = string
  default     = "qubera.ai."
}

variable "playground_image_tag" {
  description = "Tag in the playground ECR repository the task definition starts from; the deploy workflow registers later revisions."
  type        = string
  default     = "latest"
}

variable "playground_task_cpu" {
  description = "Fargate CPU units for the playground task. An estimate until the first hosted run measures it."
  type        = number
  default     = 2048
}

variable "playground_task_memory" {
  description = "Fargate memory (MiB) for the playground task."
  type        = number
  default     = 6144
}

variable "playground_idle_minutes" {
  description = "Minutes without a request at the load balancer before the service scales to zero."
  type        = number
  default     = 30
}

variable "playground_log_retention_days" {
  description = "CloudWatch retention for the playground task's log group."
  type        = number
  default     = 30
}
