Pattern: Disabled backup retention for AWS ElastiCache
Issue: -
Redis clusters should have a snapshot retention time to ensure that they are backed up and can be restored if required.
Resolution: Configure snapshot retention for Redis cluster.
Example of incorrect code:
resource "aws_elasticache_cluster" "bad_example" {
cluster_id = "cluster-example"
engine = "redis"
node_type = "cache.m4.large"
num_cache_nodes = 1
parameter_group_name = "default.redis3.2"
engine_version = "3.2.10"
port = 6379
}
Example of correct code:
resource "aws_elasticache_cluster" "good_example" {
cluster_id = "cluster-example"
engine = "redis"
node_type = "cache.m4.large"
num_cache_nodes = 1
parameter_group_name = "default.redis3.2"
engine_version = "3.2.10"
port = 6379
snapshot_retention_limit = 5
}