Delete Idle ElastiCache/Memcached Cluster
What It Does
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 and Scope
Risk Level
Medium
AWS Service Targeted
Amazon ElastiCache
Permissions Required
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.
Optimization Policies Addressed
This runbook remediates violation tickets of the following policy:
elc_101
Idle ElastiCache Memcached clusters should be deleted
Risk Mitigation
Risk Mitigation Strategy
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.
How to Install
Runbook Workflow
Step 1: Start
Trigger: Begins the runbook to identify and delete idle ElastiCache clusters.
Step 2: CheckForCacheType
Action: Runs a script to determine the type of ElastiCache (Memcached, serverless, or provisioned) for each idle cluster.
Step 3: If/Else
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.
See How It Works
Triggering the Runbook
To run this workflow:
1. Locate the Ticket
Identify the ticket associated with the above mentioned policy violation.
2. Execute the Runbook
Last updated