# Elasticache Redis instance for chatbot conversation history only.
# Not shared with any other graphql-abacus feature or service.
module "graphql_abacus_chatbot_cache" {
  source = "git@github.com:theorchard/terraform-elasticache.git//?ref=4.0.0"

  providers = {
    aws.dns = aws.networking
  }

  environment                = var.environment
  service_name               = "${var.service_name}-chatbot"
  application_family         = var.application_family
  cache_engine               = "redis"
  redis_engine_version       = "7.1"
  cache_subnet_group_name    = "${var.environment}-elasticache-subnet-group"
  cache_node_type            = "cache.t4g.micro"
  cache_parameter_group_name = "default.redis7"
  vpc_id                     = module.vpc_info.vpc_id
}

module "graphql_abacus_chatbot_cache_dashboard" {
  source = "git@github.com:theorchard/terraform-datadog.git//modules/elasticache?ref=6.16.0"

  environment        = var.environment
  service_name       = "${var.service_name}-chatbot"
  application_family = var.application_family
  teams              = ["abacus-${var.environment}"]

  notification_endpoints            = "@slack-monitoring @slack-graphql"
  escalation_notification_endpoints = "@slack-graphql"
}
