data "aws_route53_zone" "networking_route53_zone" {
  provider = aws.networking
  name     = "theorchard.io"
}

module "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
  }

  cache_transit_encryption_enabled = false

  environment                     = var.environment
  service_name                    = var.service_name
  application_family              = var.application_family
  redis_engine_version            = "5.0.6"
  cache_engine                    = "redis"
  cache_subnet_group_name         = "prod-vpc-orchard-subnet"
  cache_node_type                 = "cache.t4g.micro"
  cache_parameter_group_name      = "default.redis5.0"
  vpc_id                          = module.vpc_info.vpc_id
  additional_cidr_blocks_enabled  = true
  additional_cidr_blocks = [
    "10.30.0.0/22",
    "192.168.32.0/24",
    "192.168.33.0/24",
    "192.168.40.0/22",
    "10.40.0.0/22",
  ]
}
