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. For Redis clusters, 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 before deleting them, so the Fixer uses the ElastiCache DescribeCacheClusters API to fetch the cluster’s configuration and then stores the JSON configuration on S3 as a backup.
Location: `cloudfix-fixer-executions<AccountId>/EcCleanupIdleClusters/<Engine>/<ClusterName>.json`
Where:
- `AccountId` is the AWS Account Id
- `Engine` is the Elasticache engine type
- `ClusterName` is the name of the Elasticache cluster
Once the configuration backup has been stored, the Finder uses the ElastiCache DeleteCacheCluster API API to delete the cluster.
Redis clusters
The Finder uses the ElastiCache DeleteCacheCluster API with the _FinalSnapshotIdentifier_ parameter to create a snapshot of the cluster and then delete the cluster.
Is it possible to rollback once CloudFix implements the fixer?
Yes - the rollback procedure differs depending on whether it is a Redis or Memcached cluster:
Redis clusters
- 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
- Retrieve the configuration backup file from S3 and parse the configuration, passing the parameters to the ElastiCache CreateCacheCluster API.
Can CloudFix implement the fix automatically once I accept the recommendation?
Yes.
Does this fix require downtime?
No.
Additional Resources:
Comments
0 comments
Article is closed for comments.