variable "env_config" {
  description = "Configuration object containing AWS account details and VPC settings"

  type = object({
    aws_account          = string
    env                  = string
    humand_vpc_id        = string
    public_cluster_name  = string
    private_cluster_name = string
    cidr_block           = string
  })
}

variable "docker_image" {
  description = "Docker image to deploy"
  type        = string
}

variable "ingress_lb_tg" {
  description = "Target group that this service will be attached to"
  type        = string
}

variable "spot_ratio" {
  description = "Ratio of Spot Fargate instances"
  type        = number
  default     = 0

  validation {
    condition     = var.spot_ratio >= 0 && var.spot_ratio <= 1
    error_message = "The spot_ratio must be a number between 0 and 1 (inclusive)."
  }
}

variable "enable_autoscaling" {
  description = "Enable autoscaling for the ECS service"
  type        = bool
  default     = false
}

variable "autoscaling_min_capacity" {
  description = "Minimum number of tasks for autoscaling"
  type        = number
  default     = 1
}

variable "autoscaling_max_capacity" {
  description = "Maximum number of tasks for autoscaling"
  type        = number
  default     = 2
}

variable "cpu_target_utilization_percent" {
  description = "Target CPU utilization percentage for autoscaling"
  type        = number
  default     = 70
}

variable "scale_in_cooldown" {
  description = "Cooldown period for scale in operations (in seconds)"
  type        = number
  default     = 300
}

variable "scale_out_cooldown" {
  description = "Cooldown period for scale out operations (in seconds)"
  type        = number
  default     = 300
}

variable "cpu" {
  description = "Cpu of the ECS task"
  type        = number
  default     = 1024
}

variable "memory" {
  description = "Memory of the ECS task"
  type        = number
  default     = 2048
}

variable "sns_topic_arns" {
  description = "List of SNS topic arns where this service publishes events"
  type        = list(string)
  default     = []
}

variable "secret_overrides" {
  description = "Overrides for environment-specific ssm secrets"
  type        = map(any)
  default     = {}
}

variable "environment_overrides" {
  description = "Overrides for environment-specific environment variables"
  type        = map(any)
  default     = {}
}

variable "instance_duplication_bucket" {
  description = "Name of the instance duplication S3 bucket (creates implicit Terraform dependency)"
  type        = string
}

variable "instance_duplication_sns_topic_arn" {
  description = "ARN of the instance duplication SNS topic (creates implicit Terraform dependency)"
  type        = string
}

variable "time_tracking_face_assignments_queue_arn" {
  description = "ARN of the time tracking face assignments SQS queue (for IAM SendMessage)"
  type        = string
}

variable "time_tracking_face_assignments_dlq_arn" {
  description = "ARN of the time tracking face assignments DLQ (for IAM SendMessage)"
  type        = string
}
