variable "aws_region" {
  description = "The AWS region to deploy the resources."
  type        = string
  default     = "us-east-1"
}

variable "environment" {
  description = "The environment for the EKS cluster (e.g. dev, qa, prod)."
  type        = string
  default     = "dev"
}

variable "cluster_name" {
  description = "Name of the EKS cluster"
  type        = string
  default     = "stripo-eks-dev"
}

variable "cluster_version" {
  description = "Kubernetes version for the EKS cluster"
  type        = string
  default     = "1.35"
}

variable "service_name" {
  description = "Name of the service"
  type        = string
  default     = "stripo-v2"
}

variable "application_family" {
  description = "Application family of which this is a component. Used for tagging"
  type        = string
  default     = "stripo"
}

variable "team_name" {
  type        = string
  default     = "devops"
}

variable "bucket_name" {
  description = "Name of the s3 bucket"
  type        = string
  default     = "stripo-v2-documents"
}

variable "assets_bucket_name" {
  description = "Name of the s3 bucket for editor assets"
  type        = string
  default     = "stripo-v2-assets"
}

variable "documents_domain" {
  description = "Domain name for the documents CDN"
  type        = string
  default     = "stripo-v2-documents"
}

variable "cloudfront_logs_bucket" {
  description = "Name of the s3 bucket for cloudfront logs"
  type        = string
  default     = "dev-orcd-cloudfront-logs.s3.amazonaws.com"
}

variable "editor_assets_domain" {
  description = "Domain name for the editor assets CDN"
  type        = string
  default     = "stripo-v2-assets"
}

# variable "emple_ui_alb_dns_name" {
#   description = "DNS name of the ALB serving emple-ui in EKS. Set after deploying the Kubernetes Ingress."
#   type        = string
#   default     = ""
# }

variable "additional_tags" {
  type        = map(string)
  description = "Optional map of additional tags to set on resources. These will be combined with programmatically set required tags."
  default     = {}
}

variable "secrets_manager_v2_nats" {
  description = "List of secrets for NATS"
  type        = list(string)
  default = [
    "NATS_USERNAME",
    "NATS_PASSWORD",
  ]
}

variable "secrets_manager_v2_redis" {
  description = "List of secrets for Redis"
  type        = list(string)
  default = [
    "REDIS_PASSWORD",
  ]
}

variable "secrets_manager_v2_tidb" {
  description = "List of secrets for TiDB"
  type        = list(string)
  default = [
    "TIDB_USERNAME",
    "TIDB_PASSWORD",
  ]
}

variable "secrets_manager_v2_jwt" {
  description = "List of secrets for JWT"
  type        = list(string)
  default = [
    "JWT_SECRET",
  ]
}

variable "secrets_manager_v2_security_inter_service" {
  description = "List of secrets for security inter-service auth"
  type        = list(string)
  default = [
    "SECURITY_SERVICE_PASSWORD_V2",
  ]
}

variable "secrets_manager_v2_coediting_core_service" {
  description = "List of secrets for coediting-core-service"
  type        = list(string)
  default = [
    "AUTH_USERNAME",
    "AUTH_PASSWORD",
  ]
}

variable "secrets_manager_v2_ai_service" {
  description = "List of secrets for ai-service"
  type        = list(string)
  default = [
    "RDS_DB_USERNAME",
    "RDS_DB_PASSWORD",
  ]
}

variable "secrets_manager_v2_security_service" {
  description = "List of secrets for stripo-security-service"
  type        = list(string)
  default = [
    "RDS_DB_USERNAME",
    "RDS_DB_PASSWORD",
    "AUTH_USERNAME",
    "AUTH_PASSWORD_V2",
  ]
}

variable "secrets_manager_v2_api_gateway" {
  description = "List of secrets for stripo-plugin-api-gateway"
  type        = list(string)
  default = [
    "INNER_SERVICE_PASSWORD",
    "TIMER_PASSWORD",
    "REDISSON_PASSWORD",
  ]
}

variable "secrets_manager_v2_timer_api" {
  description = "List of secrets for stripo-timer-api"
  type        = list(string)
  default = [
    "RDS_DB_USERNAME",
    "RDS_DB_PASSWORD",
    "TIMER_PASSWORD",
    "SECURITY_PASSWORD_V2",
    "TIMER_USERNAME",
    "SECURITY_USER_NAME",
  ]
}

variable "secrets_manager_v2_documents_service" {
  description = "List of secrets for stripo-plugin-documents-service"
  type        = list(string)
  default = [
    "RDS_DB_USERNAME",
    "RDS_DB_PASSWORD",
    "STORAGE_ACCESS_KEY",
    "STORAGE_SECRET_KEY",
  ]
}

variable "secrets_manager_v2_custom_blocks_service" {
  description = "List of secrets for stripo-plugin-custom-blocks-service"
  type        = list(string)
  default = [
    "RDS_DB_USERNAME",
    "RDS_DB_PASSWORD",
  ]
}

variable "secrets_manager_v2_statistics_service" {
  description = "List of secrets for stripo-plugin-statistics-service"
  type        = list(string)
  default = [
    "RDS_DB_USERNAME",
    "RDS_DB_PASSWORD",
  ]
}

variable "secrets_manager_v2_details_service" {
  description = "List of secrets for stripo-plugin-details-service"
  type        = list(string)
  default = [
    "RDS_DB_USERNAME",
    "RDS_DB_PASSWORD",
  ]
}

variable "secrets_manager_v2_html_gen_service" {
  description = "List of secrets for stripe-html-gen-service"
  type        = list(string)
  default = [
    "RDS_DB_USERNAME",
    "RDS_DB_PASSWORD",
    "AUTH_SWAGGER_PASSWORD",
  ]
}

variable "secrets_manager_v2_proxy_service" {
  description = "List of secrets for stripo-plugin-proxy-service"
  type        = list(string)
  default = [
    "SECURITY_SERVICE_PASSWORD_V2",
  ]
}

variable "secrets_manager_v2_image_bank_service" {
  description = "List of secrets for stripo-plugin-image-bank-service"
  type        = list(string)
  default = [
    "RDS_DB_USERNAME",
    "RDS_DB_PASSWORD",
  ]
}

variable "secrets_manager_v2_countdowntimer" {
  description = "List of secrets for countdowntimer"
  type        = list(string)
  default = [
    "RDS_DB_USERNAME",
    "RDS_DB_PASSWORD",
    "SECRET_KEY",
  ]
}

variable "secrets_manager_v2_amp_validator_service" {
  description = "List of secrets for amp-validator-service"
  type        = list(string)
  default = [
    "AUTH_PASSWORD",
  ]
}

variable "secrets_manager_v2_html_cleaner_service" {
  description = "List of secrets for stripe-html-cleaner-service"
  type        = list(string)
  default = [
    "AMP_VALIDATOR_PASSWORD",
    "AUTH_SWAGGER_PASSWORD",
  ]
}

variable "secrets_manager_v2_drafts_service" {
  description = "List of secrets for stripo-plugin-drafts-service"
  type        = list(string)
  default = [
    "RDS_DB_USERNAME",
    "RDS_DB_PASSWORD",
  ]
}

locals {
  combined_resource_tags = merge(
    {
      environment        = var.environment
      service_name       = var.service_name
      application_family = var.application_family
      terraformed        = true
    },
    var.additional_tags
  )
}
