Opportunity Name:
Clean up idle ElastiCache clusters
AWS Resource Type:
Amazon ElastiCache
Opportunity Description:
Amazon ElastiCache clusters incur hourly costs whether or not they are used. This FF identifies ElastiCache clusters that have been idle for an extended period of time, creates snapshots, and terminates the clusters.
Criteria for identifying the opportunity:
An opportunity is identified if the cluster has not received any read or write commands for the last 7 days (this idle window is configurable per tenant, from 1 to 90 days). For Redis clusters (Valkey clusters are evaluated the same way), this means that the sum of the _GetTypeCmds_ and _SetTypeCmds_ metrics must be zero, and for Memcached clusters the sum of the _CmdGet_ and _CmdSet_ metrics must be zero.
Potential savings (range in % on annual basis):
This FF can save 100% of idle ElastiCache Memcached cluster costs, and approximately 99% of idle ElastiCache Redis cluster costs. The remaining 1% of costs for Redis clusters is due to the cost of storing the snapshot ($0.10 per GB-month) that is created before the cluster is deleted.
What happens when the Fixer is executed?
The actions performed by the Fixer depend on the ElastiCache cluster type.
Memcached clusters
AWS does not support taking snapshots of Memcached clusters, and CloudFix does not create any other form of backup before deleting one. The Fixer calls the ElastiCache DeleteCacheCluster API directly, with no preceding backup step.
Redis clusters
The Fixer creates a final snapshot before deleting the cluster:
- For single-node Redis clusters, the Fixer calls the ElastiCache DeleteCacheCluster API with the _FinalSnapshotIdentifier_ parameter.
- For clusters with read replicas (replication groups), the Fixer calls the ElastiCache DeleteReplicationGroup API with the _FinalSnapshotIdentifier_ parameter.
Is it possible to rollback once CloudFix implements the fixer?
It depends on the cluster type:
Redis clusters
Yes - a final snapshot is created before the cluster is deleted, so it can be recreated from that snapshot:
- For single-node Redis clusters, call the ElastiCache CreateCacheCluster API, passing the ARN of the snapshot using the _SnapshotArns_ parameter.
- For clusters with read replicas, call the ElastiCache CreateReplicationGroup API passing the ARNs of the snapshots using the _SnapshotArns_ parameter.
Memcached clusters
No - since AWS does not support Memcached snapshots and CloudFix does not create any other backup of the cluster’s configuration before deletion, a deleted Memcached cluster cannot be restored automatically. To bring the cache back, you would need to manually create a new ElastiCache cluster and reconfigure it (node type, parameter group, security groups, subnet group, etc.) using your own records of the original setup; the cached data itself cannot be recovered either way.
Can CloudFix implement the fix automatically once I accept the recommendation?
Yes.
Does this fix require downtime?
No.
Additional Resources:
Priyanka Bhotika
Comments