module "code_push_server_cache" {
  source = "git@github.com:theorchard/terraform-elasticache.git//?ref=3.1.1"

  providers = {
    aws.dns = aws
  }

  environment                = var.environment
  service_name               = "${var.service_name}-cache"
  application_family         = var.application_family
  cache_engine               = "redis"
  cache_subnet_group_name    = "${var.environment}-elasticache-subnet-group"
  cache_node_type            = "cache.t4g.micro"
  cache_parameter_group_name = "default.redis7"
  route53_zone_id            = data.aws_route53_zone.route53_zone.zone_id
  vpc_id                     = module.vpc_info.vpc_id
}

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

  application_family = var.application_family
  environment        = var.environment
  service_name       = var.service_name

  notification_endpoints            = var.notification_endpoints
  escalation_notification_endpoints = var.escalation_notification_endpoints
}
