variable "identifier" {
  description = "RDS instance identifier"
  type        = string
}

variable "engine" {
  description = "Oracle engine edition — oracle-ee, oracle-ee-cdb, oracle-se2, oracle-se2-cdb"
  type        = string
  default     = "oracle-ee"
}

variable "engine_version" {
  description = "Oracle engine version"
  type        = string
  default     = "19.0.0.0.ru-2024-04.rur-2024-04.r1"
}

variable "license_model" {
  description = "License model — license-included or bring-your-own-license"
  type        = string
  default     = "bring-your-own-license"
  validation {
    condition     = contains(["license-included", "bring-your-own-license"], var.license_model)
    error_message = "license_model must be license-included or bring-your-own-license."
  }
}

variable "instance_class" {
  description = "RDS instance class"
  type        = string
  default     = "db.m5.large"
}

variable "allocated_storage" {
  description = "Allocated storage in GiB"
  type        = number
  default     = 100
}

variable "max_allocated_storage" {
  description = "Maximum storage for autoscaling"
  type        = number
  default     = 500
}

variable "username" {
  description = "Master username"
  type        = string
  default     = "admin"
}

variable "manage_master_user_password" {
  description = "Let RDS manage the master password in Secrets Manager"
  type        = bool
  default     = true
}

variable "subnet_ids" {
  description = "Subnet IDs for the DB subnet group"
  type        = list(string)
}

variable "security_group_ids" {
  description = "Security group IDs"
  type        = list(string)
}

variable "multi_az" {
  description = "Enable Multi-AZ"
  type        = bool
  default     = true
}

variable "kms_key_id" {
  description = "KMS key ARN for storage encryption"
  type        = string
  default     = null
}

variable "backup_retention_period" {
  description = "Days to retain automated backups"
  type        = number
  default     = 7
}

variable "deletion_protection" {
  description = "Enable deletion protection"
  type        = bool
  default     = true
}

variable "skip_final_snapshot" {
  description = "Skip final snapshot on deletion"
  type        = bool
  default     = false
}

variable "monitoring_interval" {
  description = "Enhanced monitoring interval in seconds"
  type        = number
  default     = 60
}

variable "character_set_name" {
  description = "Oracle database character set"
  type        = string
  default     = "AL32UTF8"
}

variable "option_group_name" {
  description = "Custom option group name (optional)"
  type        = string
  default     = null
}

variable "parameters" {
  description = "Map of DB parameter names to values"
  type        = map(string)
  default     = {}
}

variable "tags" {
  description = "Resource tags to apply to all resources"
  type        = map(string)
  default     = {}
}
