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 "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 "dd_api_key_secret" {
  type        = string
  description = "ARN of secret which contains datadog api key"
}

variable "dd_docker_image" {
  type        = string
  description = "Datadog agent image"
  default     = "public.ecr.aws/datadog/agent:latest"
}

variable "dd_log_group_name" {
  type        = string
  description = "Log group of datadog agent"
}

variable "dd_apm_enabled" {
  type        = string
  description = "Datadog container DD_APM_ENABLED variable"
  default     = "true"
}

variable "dd_logs_injection" {
  type        = string
  description = "Enable connecting logs and traces Injection."
  default     = "false"
}

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 "namespace_id" {
  type        = string
  description = "The ID of the namespace that you want to use to create the service."
}

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
}
