variable "profile" {
  type = string
}

variable "cluster_name" {
  type = string
}

variable "region" {
  type = string
}

variable "zone_ids" {
  type = list(string)

  validation {
    condition     = length(var.zone_ids) == 3
    error_message = "You must specify exactly 3 AZ IDs."
  }
}

variable "node_groups" {
  type = list(object({
    name                 = string
    instance_types       = optional(list(string), ["ecs.g9a.xlarge", "ecs.g9i.xlarge", "ecs.g8i.xlarge"])
    desired_size         = optional(number, 3)
    system_disk_category = optional(string, "cloud_essd")
    system_disk_size     = optional(number, 40)
    data_disk_category   = optional(string, "cloud_essd")
    data_disk_size       = optional(number, 100)
    auto_scaling = optional(object({
      enable = bool
      min : number
      max : number
      }), {
      enable = false
      min    = 1
      max    = 5
    })
  }))
  default = [{
    name = "default-nodepool"
  }]
}

variable "vpc_cidr" {
  type    = string
  default = "10.0.0.0/8"

  validation {
    condition     = can(cidrhost(var.vpc_cidr, 0))
    error_message = "vpc_cidr must be a valid CIDR block"
  }
}

variable "service_cidr" {
  type    = string
  default = "172.20.0.0/16"

  validation {
    condition     = can(cidrhost(var.service_cidr, 0))
    error_message = "service_cidr must be a valid CIDR block"
  }
}

variable "public_access_cidrs" {
  type    = list(string)
  default = []
}

variable "admin_ram_ids" {
  type    = list(string)
  default = []
}

variable "acr_region" {
  type = string
}

variable "acr_instance_id" {
  type = string
}

variable "tags" {
  type    = map(string)
  default = {}
}
