ElastiCache replication group with transit encryption disabled

Protect ElastiCache replication-group client connections and node-to-node traffic with TLS.

Description

Enable TLS on the ElastiCache replication group to encrypt requests from clients and traffic between cache nodes. Configure client authentication and storage encryption separately.

Potential impact

Without TLS, someone on the network path can read or alter cache requests and responses, including session data.

Remediation

  • Set transit_encryption_enabled = true. Configure clients to connect with TLS and verify the server certificate.
  • Existing groups support enabling TLS in place on Valkey 7.2 or later and Redis OSS 7 or later. Upgrade older engines first. For the transition, set transit_encryption_mode to preferred, move all clients to TLS, then set it to required and confirm plaintext connections are rejected.

Examples

For this two-node example, use an engine and node type supported in your Region, a cache subnet group in your VPC and suitable security groups.

Before

hcl
resource "aws_elasticache_replication_group" "example" {
  automatic_failover_enabled    = true
  preferred_cache_cluster_azs            = ["us-west-2a", "us-west-2b"]
  replication_group_id          = "tf-rep-group-1"
  description = "test description"
  node_type                     = "cache.m4.large"
  num_cache_clusters         = 2
  port                          = 6379
}

The first example omits the transit encryption setting. Check whether the deployed group actually uses TLS.

After

hcl
resource "aws_elasticache_replication_group" "example" {
  automatic_failover_enabled    = true
  preferred_cache_cluster_azs            = ["us-west-2a", "us-west-2b"]
  replication_group_id          = "tf-rep-group-1"
  description = "test description"
  node_type                     = "cache.m4.large"
  num_cache_clusters         = 2
  port                          = 6379
  transit_encryption_enabled    = true
}

The second example enables transit encryption on the group. Client TLS settings and the migration mode are configured separately.

References