module "vector_phys_loc_13_queue_elasticache" {
  # checkov:skip=CKV_AWS_30:ElastiCache encryption in transit requires client library update. Will deal with this later.
  # checkov:skip=CKV_AWS_31:ElastiCache encryption in transit requires client library update. Will deal with this later.

  source = "git@github.com:theorchard/terraform-elasticache.git//?ref=4.0.0"

  providers = {
    aws.dns = aws.networking
  }

  environment                      = var.environment
  service_name                     = "vector-phys-loc-13"
  application_family               = var.application_family
  redis_engine_version             = "7.1"
  cache_parameter_group_name       = "default.redis7"
  cache_engine                     = "redis"
  cache_subnet_group_name          = "${var.environment}-elasticache-subnet-group"
  cache_transit_encryption_enabled = false
  cache_node_type                  = "cache.t4g.medium"
  redis_snapshot_window            = "08:30-09:30"
  cache_maintenance_window         = "wed:06:00-wed:07:00"
  vpc_id                           = data.aws_vpc.vpc.id
  additional_cidr_blocks_enabled   = true
  additional_cidr_blocks = concat(
    var.additional_cidr_blocks,
    [for subnet in data.aws_subnet.vector_subnets : subnet.cidr_block]
  )
}
