ElastiCache default subnet groups: the basics
Why the subnet group your cluster lands in is a security decision
An ElastiCache cluster doesn't float free in your account — it lives inside specific subnets, and the set of subnets it's allowed to use is called a subnet group. When you launch a cluster without naming a subnet group, ElastiCache creates or reuses one literally named default, built from the subnets of your default VPC. That's the convenient path, and it's exactly the path this control flags.
ElastiCache.7 checks whether a cluster's CacheSubnetGroupName is the string default. If it is, the control fails at High severity. The reasoning is network blast radius: the default VPC and its subnets are deliberately permissive so that getting started is easy, which is the opposite of what you want around a data store holding session tokens, cached credentials, or query results. A custom subnet group lets you place the cluster in private subnets you've deliberately chosen, with the route tables and NACLs you've deliberately set.
It's flagged High because a cache is a high-value, low-visibility target. Nobody logs into ElastiCache the way they log into a database, so a cluster sitting in the default VPC with broad networking can be reachable far more widely than its owner assumes — and the misconfiguration is invisible until someone audits it or, worse, exploits it.
In this lesson you'll learn what an ElastiCache subnet group actually controls, why the default group inherits the permissive networking of the default VPC, and how to move a cluster onto a purpose-built custom subnet group made of private subnets. You'll see the AWS CLI commands to find non-compliant clusters and create a proper subnet group, the catch that you can't change a running cluster's subnet group in place, and the guardrails — Config rules and infrastructure-as-code defaults — that stop the problem recurring.
The cache nobody knew was reachable
When you launch an ElastiCache cluster through the console and skip the subnet-group step, AWS doesn't stop you — it silently creates a group named default from your default VPC's subnets and proceeds. Because every AWS account ships with a default VPC whose subnets are all public-route-table-attached unless you've changed them, a cluster on the default subnet group can end up one security-group rule away from the open internet. Teams routinely discover during their first security audit that a cache they assumed was "internal" had been sitting in default networking for years — not because anyone chose it, but because nobody chose anything.
Moving a cluster off the default subnet group in action
Dev is the platform engineer on call when the Security Hub digest lands with a new High finding: ElastiCache.7 on prod-sessions-cache, a Redis cluster the auth service leans on. The control failed because its CacheSubnetGroupName is default — it was spun up during a hackathon eighteen months ago and never moved.
He confirms the blast radius first. The cluster is in the default VPC, and two of that VPC's three subnets route to an internet gateway. The cache's security group is tight today, but he's one careless rule away from exposing a store of live session tokens. This is worth fixing properly, not patching the security group.
He can't repoint a running cluster's subnet group — ElastiCache doesn't allow it. So he creates a custom subnet group from the three private subnets in the app VPC, takes a backup of the live cluster, and provisions a replacement cluster on the new group during the next maintenance window. The app's connection string moves to the new endpoint, the old cluster is deleted, and the finding clears on the next Config evaluation. Total hands-on time: under an hour, most of it waiting on the new cluster to come up.
First, find every ElastiCache cluster still using the default subnet group — that's exactly what the control flags.
Any cluster whose SubnetGroup is 'default' fails the control; the named custom group is the compliant pattern.
Create a custom subnet group from your private subnets. This is the network the new cluster will live in.
A custom subnet group built from private subnets you control — the destination for a compliant replacement cluster.
ElastiCache subnet groups under the hooddeep dive
A cache subnet group is a named collection of VPC subnets that tells ElastiCache where it's allowed to place cache nodes. At launch, ElastiCache picks a subnet from the group for each node, attaches an elastic network interface in that subnet, and the node inherits everything that subnet implies: its route table (and therefore whether it routes to an internet gateway or NAT), its network ACLs, and its availability zone. The security group attached to the cluster layers on top, but the subnet decides the foundational network position. ElastiCache.7 fails precisely when CacheSubnetGroupName equals default, because that group is composed from the default VPC's subnets, which are public-routed unless explicitly changed.
The critical operational constraint is that a cluster's subnet group is immutable after creation. There is no modify-cache-cluster --cache-subnet-group-name — the parameter doesn't exist for in-place modification. To move a cluster off default you must create a new cluster on the desired subnet group and migrate to it. For a standalone cache you snapshot and restore onto the new group; for a Redis OSS / Valkey replication group you can use online migration or a backup-and-restore into a new replication group, then cut the application's endpoint over. The new subnet group must contain subnets in the same VPC and should span at least two availability zones for any multi-node or failover-enabled deployment.
Worth knowing: the default subnet group is created lazily. If you launch a cluster via the console or API without specifying a group and one named default doesn't yet exist, ElastiCache creates it from the default VPC's subnets on the spot — so a cluster can end up non-compliant without anyone ever having typed the word default. The AWS Config rule elasticache-subnet-group-check backs the control and re-evaluates on a periodic schedule, which is why a freshly remediated cluster clears on the next evaluation rather than instantly.
# 1. Confirm the offending cluster's subnet group and capture its endpoint.
aws elasticache describe-cache-clusters \
--cache-cluster-id prod-sessions-cache \
--show-cache-node-info \
--query 'CacheClusters[0].{SubnetGroup:CacheSubnetGroupName,Nodes:CacheNodes[].Endpoint}'
# 2. Snapshot the live cluster before rebuilding (Redis OSS / Valkey only).
aws elasticache create-snapshot \
--cache-cluster-id prod-sessions-cache \
--snapshot-name prod-sessions-pre-migration
# 3. Restore into a NEW cluster on the custom subnet group.
aws elasticache create-cache-cluster \
--cache-cluster-id prod-sessions-cache-v2 \
--snapshot-name prod-sessions-pre-migration \
--cache-subnet-group-name app-private-sng \
--engine redis \
--num-cache-nodes 1 \
--cache-node-type cache.r6g.large
# 4. Cut the app over to the new endpoint, verify, then delete the old cluster. What is the impact of an ElastiCache cluster on the default subnet group?
The direct impact is network exposure. The default VPC ships with subnets attached to a route table that points to an internet gateway, so a cluster placed there is, by default, in a publicly-routable network segment. The cluster's security group is the only thing standing between it and broad reachability — and security groups drift. A single over-broad ingress rule, a 0.0.0.0/0 added "temporarily" for debugging, or a peering connection into the default VPC can turn an assumed-internal cache into an internet-adjacent one holding live data.
The second-order impact is segmentation failure. The whole point of placing data stores in dedicated private subnets is to contain blast radius: if an application host is compromised, the attacker's lateral movement is bounded by network design. A cache sitting in the shared default VPC undermines that boundary — it sits alongside whatever else got launched into default networking, with the permissive intra-VPC connectivity the default configuration encourages. The control maps to a long list of NIST 800-53 boundary-protection requirements precisely because it's a segmentation control, not a cosmetic one.
The compliance impact is concrete and recurring. ElastiCache.7 is a High-severity control, so it materially affects your Security Hub score, it surfaces in audit evidence, and it's the kind of line item that appears verbatim on enterprise customer security questionnaires. An open High finding against a data store is hard to wave away in a SOC 2 review or a vendor-risk assessment; "we run caches on the default network" is not an answer that builds trust.
Notably, there is no cost impact and no performance trade-off. Moving to a custom subnet group doesn't change the instance type, the node count, or the data-transfer profile. This is a pure posture fix — the only "cost" is the one-time engineering effort of rebuilding the cluster on a new group and cutting the application over. That asymmetry — meaningful risk reduction for near-zero cost — is exactly why it's worth doing promptly rather than deferring.
How do you move an ElastiCache cluster to a custom subnet group?
Because a cluster's subnet group can't be changed in place, remediation is a build-and-migrate loop: create the right network, stand up a replacement cluster on it, cut over the application, then prevent recurrence at the deployment layer.
1. Inventory every cluster on the default subnet group
List all ElastiCache clusters across every region and account and filter for CacheSubnetGroupName == default. For each, record the engine, the VPC it's in, whether it holds sensitive data, and whether its current security group or route table actually exposes it. The exposed-and-sensitive ones are the priority; an internal-only dev cache on default networking is the same finding but a lower-urgency fix.
2. Create a custom subnet group from private subnets
Build a cache subnet group from subnets that have no route to an internet gateway, spanning at least two availability zones for any failover-enabled or multi-node cluster. Reuse one well-named group per data tier (for example app-private-sng) rather than creating one per cluster — it keeps the network design legible and the group itself is free. The subnets must be in the same VPC the replacement cluster will live in.
3. Rebuild the cluster on the new group and cut over
You cannot repoint a running cluster, so snapshot the existing one and restore into a new cluster created with --cache-subnet-group-name set to your custom group (for Redis OSS / Valkey replication groups, online migration is also an option). Validate the new endpoint, update the application's connection string, confirm traffic has moved, then delete the old cluster. Schedule the cutover in a maintenance window — there's a brief reconnect for clients.
4. Prevent recurrence at the deployment layer
Set the standard in infrastructure-as-code so no cluster is ever created without an explicit, non-default subnet group — make cache_subnet_group_name a required input in your Terraform/CloudFormation module. Back it with the AWS Config rule elasticache-subnet-group-check (the rule behind this control) and, ideally, a release gate that blocks any deployment targeting a default VPC. The one-time fix only holds if the next cluster is born compliant.
# Find all clusters on the default subnet group, across the account.
aws elasticache describe-cache-clusters \
--query "CacheClusters[?CacheSubnetGroupName=='default'].[CacheClusterId,Engine,CacheClusterStatus]" \
--output table
# Create the compliant custom subnet group from private subnets (>= 2 AZs).
aws elasticache create-cache-subnet-group \
--cache-subnet-group-name app-private-sng \
--cache-subnet-group-description 'Private subnets for app data caches' \
--subnet-ids subnet-0aa11bb22 subnet-0cc33dd44 subnet-0ee55ff66
# Verify which clusters still need migrating after each batch.
aws elasticache describe-cache-clusters \
--query "length(CacheClusters[?CacheSubnetGroupName=='default'])" Quick quiz
Question 1 of 5ElastiCache.7 fires on a production Redis cluster: its CacheSubnetGroupName is default. The cluster holds live session tokens. What's the right next move?
You scored
0 / 5
Keep learning
Dig deeper into ElastiCache subnet groups, the control behind this finding, and VPC network design.
- Creating a subnet group — Amazon ElastiCache User Guide The official remediation reference: how to create and configure a custom cache subnet group.
- Security Hub control ElastiCache.7 Authoritative control description, severity, related NIST requirements, and remediation pointer.
- AWS Config rule: elasticache-subnet-group-check The managed Config rule that backs the control and re-evaluates clusters on a periodic schedule.
- Subnets for your VPC — Amazon VPC User Guide How public and private subnets, route tables, and the default VPC work — the networking your subnet group inherits.
You've completed Configure ElastiCache clusters with a custom subnet group. You now know what a subnet group controls, why the default group inherits the permissive networking of the default VPC, the build-and-migrate loop required because the group can't be changed in place, and the infrastructure-as-code guardrails that keep new clusters compliant from birth. The next time ElastiCache.7 fires, you'll have a defensible path from "High finding" to "cleared and prevented."