variable "github_app_id" {
  description = "GitHub App ID"
  type        = string
}

variable "github_app_secret" {
  description = "GitHub App webhook secret for HMAC signature verification"
  type        = string
  sensitive   = true
}

variable "github_app_privatekey" {
  description = "PEM-encoded GitHub App private key"
  type        = string
  sensitive   = true
}

variable "environment" {
  description = "Environment name for resource tagging and naming (e.g. prod, canary)."
  type        = string
}

variable "upstream_repo" {
  description = "GitHub upstream repository in owner/repo format"
  type        = string
  default     = "pytorch/pytorch"
}

variable "allowlist_url" {
  description = "GitHub URL to the relay whitelist YAML"
  type        = string
  default     = "https://github.com/pytorch/pytorch/blob/main/.github/allowlist.yml"
}

variable "allowlist_ttl" {
  description = "Whitelist cache TTL in Redis (seconds)"
  type        = number
  default     = 1200
}

variable "vpc_cidr_block" {
  description = "CIDR block for the VPC"
  type        = string
  default     = "10.0.0.0/16"
}

variable "availability_zone_suffixes" {
  description = "Availability zone letter suffixes"
  type        = list(string)
  default     = ["a", "b"]
}

variable "hud_api_url" {
  description = "HUD API endpoint for posting downstream workflow results"
  type        = string
}

variable "hud_bot_key" {
  description = "Authorization key for the HUD API"
  type        = string
  sensitive   = true
}

variable "crcr_status_ttl" {
  description = "CRCR workflow run status TTL in Redis (seconds)"
  type        = number
  default     = 259200
}

variable "sweeper_interval_minutes" {
  description = "How often EventBridge triggers the callback lambda to reap timed-out jobs (minutes)"
  type        = number
  default     = 10

  validation {
    condition     = var.sweeper_interval_minutes >= 2
    error_message = "sweeper_interval_minutes must be >= 2; more frequent sweeps reap too few zombies to be worthwhile."
  }
}
