variable "cluster_name" {
  type = string
}

variable "cloud_region" {
  type = string
}

variable "resource_group_name" {
  type    = string
  default = ""
}

variable "create_resource_group" {
  type    = bool
  default = true
}

variable "node_resource_group_name" {
  type    = string
  default = ""
}

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

variable "authorized_ip_ranges" {
  type    = list(string)
  default = ["0.0.0.0/0"]
}

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

variable "azure_rbac_enabled" {
  type    = bool
  default = false
}

variable "control_plane_identity_id" {
  type    = string
  default = ""
}

variable "kubelet_identity_id" {
  type    = string
  default = ""
}

variable "kubelet_identity_client_id" {
  type    = string
  default = ""
}

variable "kubelet_identity_object_id" {
  type    = string
  default = ""
}

variable "create_role_assignments" {
  type    = bool
  default = true
}

variable "api_server_vnet_integration_enabled" {
  type    = bool
  default = false
}

variable "api_server_subnet_id" {
  type    = string
  default = ""
}

variable "api_server_subnet_cidr" {
  type    = string
  default = "10.0.128.0/28"

  validation {
    condition     = can(cidrhost(var.api_server_subnet_cidr, 0)) && tonumber(split("/", var.api_server_subnet_cidr)[1]) <= 28
    error_message = "api_server_subnet_cidr must be a valid CIDR block with at least /28 capacity."
  }
}

variable "manage_api_server_subnet_role_assignment" {
  type    = bool
  default = true
}

variable "acr_id_scope" {
  type = string
}

variable "nodepool_size" {
  type    = number
  default = 2
}

variable "nodepool_autoscaling_enabled" {
  type    = bool
  default = false
}

variable "nodepool_min_size" {
  type    = number
  default = 1
}

variable "nodepool_max_size" {
  type    = number
  default = 3

  validation {
    condition     = var.nodepool_max_size >= var.nodepool_min_size
    error_message = "nodepool_max_size must be greater than or equal to nodepool_min_size."
  }
}

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

variable "vm_size" {
  type    = string
  default = "Standard_DS2_v2"
}

variable "k8s_version" {
  type    = string
  default = "1.36.1"
}

variable "vnet_cidr" {
  type    = string
  default = "10.0.0.0/16"
}

variable "vnet_id" {
  type    = string
  default = ""
}

variable "vnet_name" {
  type    = string
  default = ""
}

variable "subnet_cidr" {
  type    = string
  default = "10.0.0.0/16"
}

variable "subnet_id" {
  type    = string
  default = ""
}

variable "subnet_name" {
  type    = string
  default = ""
}

variable "service_cidr" {
  type    = string
  default = "172.16.0.0/16"
}

variable "dns_service_ip" {
  type    = string
  default = "172.16.0.10"
}

variable "ingress_application_gateway_id" {
  type    = string
  default = ""
}

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