module "vector_queue_elasticache" {
  # checkov:skip=CKV_AWS_30:ElastiCache encryption in transit requires client library update.
  # checkov:skip=CKV_AWS_31:ElastiCache encryption in transit requires client library update.
  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
  application_family               = var.application_family
  redis_engine_version             = "7.1"
  cache_engine                     = "redis"
  cache_subnet_group_name          = "${var.environment}-elasticache-subnet-group"
  cache_transit_encryption_enabled = false
  cache_node_type                  = "cache.t4g.micro"
  cache_parameter_group_name       = "default.redis7"
  vpc_id                           = module.vpc_info.vpc_id
  route53_record_creation_enabled  = true
  redis_snapshot_window            = "08:30-09:30"
  cache_maintenance_window         = "wed:06:00-wed:07:00"
  additional_cidr_blocks_enabled   = true
  additional_cidr_blocks = [
    "192.168.32.0/24",
    "192.168.36.0/28",
    "10.40.0.0/22",
  ]
}
