variable "aws_region" {
  default     = "us-east-1"
  description = "AWS region"
}

variable "environment" {
  description = "Available values: qa, prod"
  default     = "qa"
}

variable "application_family" {
  description = "Application Family name"
  default     = "kafka-data-highway"
}

variable "msk_cluster_name" {
  description = "MSK Cluster name, without environment prefix"
  default     = "managed-kafka-fansifter"
}

variable "cluster_type" {
  # Shortened 'kafka-connect' for AWS name length limitations
  default = "kc"
}

variable "connector_type" {
  default = "sforce-sink"
}

variable "connector_name" {
  default = "fan-upd"
}

# truncate the name to fit in 32 chars. "qa-kc-sforce-sink-subscription-upd" is too long.
variable "subscription_connector_name" {
  default = "subscrib-upd"
}

variable "subscription_kafka_topic" {
  default = "cdc.preferenceCenter.fanSubscriptionUpdates"
}

variable "subscription_dlq_topic_name" {
  default = "dlq.preferenceCenter.subscriptionUpdates"
}

variable "kafka_topics" {
  default = "cdc.preferenceCenter.fanUpdates"
}

variable "dlq_topic_name_fan_updates" {
  default = "dlq.preferenceCenter.fanUpdates"
}

variable "start_reading_records_from" {
  default = "latest"
}

variable "datadog_monitor_enabled" {
  default = true
}

variable "error_monitor_threshold" {
  default = 5
}

variable "salesforce_login_url" {
  description = "Salesforce instance URL"
  default     = "https://sony--fullcopysb.sandbox.my.salesforce.com"
}

variable "notification_endpoints" {
  default = "@slack-fansifter-alerts"
}

variable "additional_tags" {
  type = map(string)
  default = {
    project = "kafka-data-highway",
    team    = "kdh"
  }
}

locals {
  service_name              = "${var.cluster_type}-${var.connector_type}-${var.connector_name}"
  subscription_service_name = "${var.cluster_type}-${var.connector_type}-${var.subscription_connector_name}"
  # For compatibility with existing image, use kafka-connect instead of kc for image prefix
  ecr_image_name = "kafka-connect-${var.connector_type}"
}
