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

Detail
Value

Risk Level

Medium

AWS Service Targeted

Amazon ElastiCache

Permissions Required

Optimization Policies Addressed

This runbook remediates violation tickets of the following policy:

Policy ID
Policy Name

elc_101

Idle ElastiCache Memcached clusters should be deleted

Risk Mitigation

Risk Mitigation Strategy

How to Install

Refer to the Runbook Setup Guide for steps to install and enable this runbook in your environment.

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.

  1. If all are in manual and available state:

    1. DeleteMemcached Executes DeleteCacheCluster for idle Memcached clusters.

    2. DeleteServerlessCache Executes DeleteServerlessCache for idle serverless clusters.

    3. DeleteProvisioned Executes DeleteReplicationGroup for idle provisioned Redis clusters.

    4. RunScript Raises a runtime error to capture error, failing the workflow explicitly.

  2. 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

Follow the steps described in the executing a runbook section to apply this runbook to the ticket.

Last updated