Delete unused EBS Volumes

What It Does

Deletes unused EBS volumes that are no longer attached to any EC2 instance. Unused volumes continue to incur storage costs even when idle. This runbook removes orphaned volumes after creating a snapshot for backup, helping reduce storage waste and control spend.

Risk and Scope

Detail
Value

Risk Level

Medium

AWS Service Targeted

Elastic Block Store (EBS)

Permissions Required

Optimization Policies Addressed

This runbook remediates violation tickets of the following policy:

Policy ID
Policy Name

ebs_2

EBS volumes should not be unattached

ebs_11

EBS volumes should not be attached to stopped instances for long periods

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: Initiates the workflow to identify and delete orphaned EBS volumes.

Step 2: validateEBS

Action:Runs a validation script to identify whether the EBS volume is unused and safe to delete.

Step 3: If/Else

Condition: Checks whether the volume qualifies for deletion.

  1. If eligible, proceeds with deletion workflow:

    1. CreateSnapshot Creates a snapshot of the EBS volume to retain a backup.

    2. WaitForSnapshotCompletion Ensures snapshot creation is complete by describing snapshot status.

    3. DeleteVolume Deletes the EBS volume to eliminate unnecessary storage cost.

  2. Else:

    Ends the workflow if no deletable volume is identified.

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