ElastiCache clusters should not use the default subnet group
Flags ElastiCache clusters using the subnet group named default, which takes its subnets from the default VPC, instead of a custom one that limits where the cluster sits. Only the name is read, so editing the subnets inside default does not clear it. A node of a replication group is reported on its own but replaced with its whole group.
- service
- ElastiCache
- severity
- High
- scope
- evaluated in every region
How to fix it
- Replaces the resource: A cluster's subnet group cannot be changed, so create the group, back up the cluster, restore into a new cache in the group, repoint clients, then delete the old cluster.
- Can break clients: The replacement has a new endpoint for every client to repoint to, and a node-based Memcached cluster has no backups, so its replacement starts empty.
In the console
ElastiCache → Subnet groups → Create subnet group, then the Subnet group setting on the replacement cache
- Name
- Any name other than default
- VPC ID
- The VPC the replacement cache will run in
- Selected subnets
- Only the private subnets the cache needs
- Subnet group
- The new group, set when restoring or creating the replacement cache
With Terraform
resource "aws_elasticache_cluster" "this" {
cluster_id = var.cluster_id
engine = var.engine
subnet_group_name = aws_elasticache_subnet_group.custom.name
}
See which of your accounts this check is failing on.
Book a live scan