variable "zones" {
  description = "Map of hosted zone definitions"
  type = map(object({
    name    = string
    comment = optional(string, "Managed by Terraform")
    private = optional(bool, false)
    vpc_ids = optional(list(string), [])
  }))
  default = {}
}

variable "records" {
  description = "Map of DNS record definitions"
  type = map(object({
    zone_key = string
    name     = string
    type     = string
    ttl      = optional(number, null)
    records  = optional(list(string), null)
    alias = optional(object({
      name                   = string
      zone_id                = string
      evaluate_target_health = optional(bool, true)
    }), null)
    health_check_id        = optional(string, null)
    set_identifier         = optional(string, null)
    weight                 = optional(number, null)
    latency_routing_policy = optional(object({ region = string }), null)
    failover               = optional(string, null)
    allow_overwrite        = optional(bool, false)
  }))
  default = {}
}

variable "health_checks" {
  description = "Map of Route 53 health checks"
  type = map(object({
    fqdn              = optional(string, null)
    ip_address        = optional(string, null)
    port              = optional(number, 443)
    type              = optional(string, "HTTPS")
    resource_path     = optional(string, "/health")
    failure_threshold = optional(number, 3)
    request_interval  = optional(number, 30)
  }))
  default = {}
}

variable "resolver_rules" {
  description = "Map of Route 53 resolver rules for hybrid DNS"
  type = map(object({
    domain_name          = string
    rule_type            = optional(string, "FORWARD")
    resolver_endpoint_id = optional(string, null)
    target_ips = optional(list(object({
      ip   = string
      port = optional(number, 53)
    })), [])
    vpc_ids = optional(list(string), [])
  }))
  default = {}
}

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