variable "env_prefix" {
  type        = string
  description = "Prefix of the environment, lowercased"
}

variable "project_group" {
  type        = string
  description = "Project group name, lowercased"
}

variable "project" {
  type        = string
  description = "Project name, lowercased"
}

variable "job_role_arn" {
  type        = string
  description = "ARN of the role under which the job will be run"
}

variable "image" {
  type        = string
  description = "ECR image which will be used for created task"
}

variable "vcpus" {
  type        = number
  description = "Virtual CPU units requirement"
  default     = 1
}

variable "memory" {
  type        = number
  description = "Memory requirement (in megabytes)"
  default     = 1024
}

variable "env_vars" {
  type        = list(map(string))
  description = "List of env_vars as map of string."
  default     = []
}

variable "env_vars_map" {
  type        = map(string)
  description = "List of env_vars as a map."
  default     = {}
}

variable "command" {
  type        = list(map(string))
  description = "Command representation as a map, will be converted to json and passed to job. Empty by default"
  default     = []
}

variable "gpu_number" {
  type        = number
  description = "Number of GPUs required for job to run. By default job doesn't need GPUs"
  default     = 0
}

variable "containers_template" {
  type        = string
  description = "Name of the container template file, module will check this filename in module own folder."
  default     = "main.tmpl"
}

variable "timeout_seconds" {
  type        = number
  default     = 600
  description = <<EOF
The time duration in seconds (measured from the job attempt's startedAt timestamp) after which AWS Batch terminates unfinished jobs.
The minimum value for the timeout is 60 seconds. Set to 600 seconds by default.
EOF

}

variable "retry_attempts" {
  type        = number
  default     = 1
  description = <<EOF
The number of times to move a job to the RUNNABLE status. You may specify between 1 and 10 attempts.
If attempts is greater than one, the job is retried that many times if it fails, until it has moved to RUNNABLE.
Set to 1 by default
EOF
}

variable "parameters" {
  type        = map(string)
  description = <<EOF
When you register a job definition, you can use parameter substitution placeholders in the command field of a job's container properties.
Parameters map set default values for this placeholders
EOF
  default     = {}
}
