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

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

variable "name" {
  type        = string
  description = "Compute environment name, lowercased"
}

variable "common_tags" {
  type        = map(string)
  description = "Map of tags applied to objects"
  default     = {}
}

variable "enabled" {
  type        = bool
  description = "Set whether compute environment is enabled or disabled. Enabled by default"
  default     = true
}

variable "batch_service_role" {
  type        = string
  description = "IAM batch service role"
}

variable "instance_role" {
  type        = string
  description = "IAM ecs instance role "
}

variable "spot_iam_fleet_role" {
  type        = string
  description = "Role for the spot fleet"
}

variable "bid_percentage" {
  type        = number
  default     = 50
  description = <<EOF
Integer of minimum percentage that a Spot Instance price must be when compared with the On-Demand price
for that instance type before instances are launched. For example, if your bid percentage is 20% (20),
then the Spot price must be below 20% of the current On-Demand price for that EC2 instance.
EOF
}

variable "instance_types" {
  type        = list(string)
  description = "List of instance types which will be used in environment. Optimal by default"
  default     = ["optimal"]
}

variable "max_vcpus" {
  type        = number
  description = "Maximum number of virtual cpus for environment. 256 by default"
  default     = 256
}

variable "min_vcpus" {
  type        = number
  description = "Minimum number of virtual cpus for environment. 0 by default"
  default     = 0
}

variable "ec2_key_pair" {
  type        = string
  description = "Name of keypair for EC2 instances"
}

variable "security_groups" {
  type        = list(string)
  description = "List of security groups ids to be applied to compute environment instances"
}

variable "subnets" {
  type        = list(string)
  description = "List of subnets where compute environment will create its resources"
}

variable "custom_image_id" {
  type        = string
  description = "In case you don't want to use latest amazon-ecs-optimized image, you can specify your own image"
  default     = ""
}


variable "disk1_size" {
  type        = number
  description = "Size of the one disk, which is used for system"
  default     = 8
}

variable "disk1_type" {
  type        = string
  description = "standard, gp2, io1, sc1 or st1"
  default     = "gp3"
}

variable "disk1_iops" {
  type        = number
  description = "IOPS if disk type set to provisioned iops"
  default     = 3000
}

variable "disk2_size" {
  type        = number
  description = "Size of the second disk, which is used for docker"
  default     = 22
}

variable "disk2_type" {
  type        = string
  description = "standard, gp2, io1, sc1 or st1"
  default     = "gp3"
}

variable "disk2_iops" {
  type        = number
  description = "IOPS if disk type set to provisioned iops"
  default     = 3000
}

variable "docker_pool_disk" {
  type        = number
  description = "The size of the disk which will be assigned to the container (in GB)"
  default     = 10
}

variable "ecs_container_stop_timeout" {
  type        = number
  description = "Amount of seconds to throw a timeout error when a container stops"
  default     = 300
}

variable "container_ulimit_nofile" {
  type        = string
  description = "Default limit of open file descriptors for docker container. Set as soft_limit:hard_limit"
  default     = "65535:65535"
}

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

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