Skip to content

ElastiCache

Deploys an ElastiCache cluster that scales automatically, backed by Valkey by default with Redis compatibility. The module opens the cluster's security group automatically to every service in ecs_services and every VPC-enabled function in lambda_functions, so services reach the cache without extra security group configuration.

Terraform configuration

Setting elasticache_config deploys one ElastiCache cluster for the application.

main.tf
module "application" {
  source = "git@github.com:BYM-IKT/terraform-byks-module.git?ref=v12"
  # ...

  elasticache_config = {
    # options go here
  }
}

Options

Option Type Default Description
engine string "valkey" Cache engine. Either redis or valkey.
major_engine_version string null Version of the cache engine, for example 7. AWS applies its own default when omitted.
override_cache_name string null Custom name for the cache cluster, instead of the generated default.
override_subnet_ids list(string) null Subnets the cluster launches into. Defaults to all private Subnets in the VPC. Must be private.

Resources