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"
}
/* Short name  could be used if we encounter aws character limits in target groups names
variable short_name {
  type        = string
  default     = ""
  description = "Short name in case we exceeded"
}*/

variable "common_tags" {
  type        = map(string)
  description = "Common tags to add for the objects"
  default     = {}
}

variable "region" {
  type        = string
  default     = "us-east-1"
  description = "Region where resources will be created"
}

variable "vpc_id" {
  type        = string
  description = "VPC id where network resources will be created"
}

variable "cluster_arn" {
  type        = string
  description = "ARN of ECS cluster of the environment"
}

variable "subnets" {
  type        = list(string)
  description = "List of subnets which ECS Service will use"
}

variable "security_groups" {
  type        = list(string)
  description = "List of security groups which will be applied to ECS Service"
}

variable "is_public" {
  default     = true
  description = "Whether or not container will be created with public IP"
}

variable "url" {
  type        = string
  description = "Hostname which will be listened by ECS Service"
}

variable "https_listener_arn" {
  type        = string
  description = "ARN of HTTPS listener of ALB"
}

variable "http_listener_arn" {
  type        = string
  description = "ARN of HTTP listener of ALB"
  default     = ""
}

variable "task_role_arn" {
  type        = string
  description = "ARN of the role which will be assigned to executing tasks"
}

variable "task_exec_role_arn" {
  type        = string
  description = "ARN of the role under which will be used to run the tasks"
}

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

variable "cpu" {
  type        = number
  description = "CPU units limit"
}

variable "memory" {
  type        = number
  description = "Memory limit (in megabytes)"
}

variable "task_count" {
  type        = number
  description = "Amount of tasks running that will be maintained under ECS service"
}

variable "secrets" {
  type        = string
  description = "Massive of secrets as a JSON. Will be directly inserted into json definition of a container"
  default     = "[]"
}

variable "env_vars" {
  type        = list(map(string))
  description = "List of maps of strings will be merged with default values and converted to json"
  default     = []
}

variable "container_port" {
  type        = number
  default     = 8080
  description = "Port which container exposes"
}

variable "tg_port" {
  type        = number
  default     = 80
  description = "Port of the target group. Generally it should not be changed."
}

variable "tg_deregistration_delay" {
  default     = 60
  description = "The amount time for Load Balancing to wait before changing the state of a deregistering target from draining to unused. The range is 0-3600 seconds."
}

variable "tg_health_check_path" {
  type        = string
  default     = "/"
  description = "The destination path for health checks. This path must begin with a '/' character, and can be at most 1024 characters in length."
}

variable "tg_health_check_matcher" {
  type        = string
  default     = "200-204"
  description = "The HTTP codes to use when checking for a successful response from a target. You can specify multiple values (for example, \"200,202\") or a range of values (for example, \"200-299\")."
}

variable "route53_zone_id" {
  type        = string
  default     = ""
  description = "ID of the DNS hosted zone in Route 53. If set, dns record will be created."
}

variable "alb_dns_name" {
  type        = string
  default     = ""
  description = "DNS name of ALB. Required if route53_zone_id is set"
}

variable "alb_zone_id" {
  type        = string
  default     = ""
  description = "DNS zone id of ALB. Required if route53_zone_id is set"
}

variable "route53_eval_health" {
  default     = false
  description = "Allow route53 to evaluate health of the targets behind it."
}

variable "enable_ecs_managed_tags" {
  default     = false
  description = "Specifies whether to enable Amazon ECS managed tags for the tasks within the service."
}

variable "deployment_minimum_healthy_percent" {
  type        = number
  description = "(Optional) The lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment."
  default     = null
}

variable "deployment_maximum_percent" {
  type        = number
  description = "(Optional) The upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment. Not valid when using the DAEMON scheduling strategy."
  default     = null
}

variable "wait_for_steady_state" {
  type        = bool
  description = "If true, Terraform will wait for the service to reach a steady state before continuing."
  default     = true
}
