Skip to content

ElastiCache clusters should not use the default subnet group

This control checks if ElastiCache clusters are configured with a custom subnet group. The control fails for an ElastiCache cluster if CacheSubnetGroupName has the value default.

How to fix

Attribute subnet_group_name of aws_elasticache_cluster must be non-empty.

Implementation options

Choose the option that matches how you manage Terraform. All options satisfy this control.

Option 1: Terraform AWS provider resources

If you manage resources directly, configure the relevant Terraform AWS provider resources to meet this control. See docs for the resources involved: aws_elasticache_cluster.

resource "aws_elasticache_cluster" "this" {
  cluster_id      = "pofix-example"
  engine          = "redis"
  node_type       = "cache.t3.micro"
  num_cache_nodes = 1

  subnet_group_name = "example-subnet-group"
}
Which option should I choose?
  • Compliance.tf module (recommended): controls enforced by default and mapped to frameworks.
  • Open source module (terraform-aws-modules): compatible by design with compliance.tf. Same variable names for an easy, low-change migration path when you are ready.
  • Terraform AWS provider resources: manage Terraform resources directly.

Tool mappings

Use these identifiers to cross-reference this control across tools, reports, and evidence.

  • Compliance.tf (CTF) Control: elasticache_cluster_no_default_subnet_group

  • AWS Config Managed Rule: ELASTICACHE_SUBNET_GROUP_CHECK

  • Checkov Check: CKV_AWS_323

  • Powerpipe Control: aws_compliance.control.elasticache_cluster_no_default_subnet_group