Delete Idle ElastiCache/Memcached Cluster
PreviousDelete EBS Snapshots for which corresponding volumes are not in useNextDelete RDS Snapshots older than a specified period of time
Last updated
Deletes idle Amazon ElastiCache clusters—Memcached, serverless, or provisioned—that are not actively used. Idle cache clusters often result in unnecessary compute and memory expenses. Removing them helps reduce cost without impacting active workloads.
Risk Level
Medium
AWS Service Targeted
Amazon ElastiCache
Delete Permissions
elasticache:DeleteCacheCluster
elasticache:DeleteReplicationGroup
elasticache:DeleteServerlessCache
Read Permissions
elasticache:DescribeCacheClusters
elasticache:DescribeReplicationGroups
elasticache:DescribeServerlessCaches
These permissions are granted only to the runbook, not to the OneLens platform itself.
This runbook remediates violation tickets of the following policy:
elc_101
Idle ElastiCache Memcached clusters should be deleted
The change is assessed as low risk with limited scope and impact.
No downtime is expected during or after implementation.
No additional safety measures are required due to the non-disruptive nature of the change.
A rollback plan is not defined, as standard procedures are sufficient to manage the change.
Refer to the Runbook Setup Guide for steps to install and enable this runbook in your environment.
Trigger: Begins the runbook to identify and delete idle ElastiCache clusters.
Action: Runs a script to determine the type of ElastiCache (Memcached, serverless, or provisioned) for each idle cluster.
Condition: Checks if any ElastiCache cluster is eligible for deletion.
If all are in manual and available state:
DeleteMemcached
Executes DeleteCacheCluster for idle Memcached clusters.
DeleteServerlessCache
Executes DeleteServerlessCache for idle serverless clusters.
DeleteProvisioned
Executes DeleteReplicationGroup for idle provisioned Redis clusters.
RunScript Raises a runtime error to capture error, failing the workflow explicitly.
Else:
Workflow terminates if no deletable cluster is found.

To run this workflow:
Identify the ticket associated with the above mentioned policy violation.
Follow the steps described in the executing a runbook section to apply this runbook to the ticket.
Last updated

