Delete EBS Snapshots for which corresponding volumes are not in use
What It Does
Deletes Amazon EBS snapshots whose corresponding volumes are no longer in use. These orphaned snapshots can consume unnecessary storage costs.
Risk and Scope
Risk Level
Low
AWS Service Targeted
Amazon EBS
Permissions Required
These permissions are granted only to the runbook, not to the OneLens platform itself.
Optimization Policies Addressed
This runbook to remediate violation tickets triggered by of the following policy:
ebs_100
EBS Snapshots of the deleted volumes should be deleted
ebs_101
EBS Snapshots of unattached EBS volumes should be deleted
ebs_102
EBS Snapshots created while copying AMI should be deleted
Risk Mitigation
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 remove orphaned EBS snapshots.
Step 2: DescribeSnapshots
Action: Calls DescribeSnapshots to retrieve all EBS snapshots.
Step 3: If/Else
Condition: Checks if any snapshots exist for which the associated EBS volumes no longer exist.
BranchOnValidSnapshot
Verifies if each snapshot state is completed.
DeleteSnapshot Executes
DeleteSnapshotfor snapshots that qualify for deletion.RunScript
Raises a runtime error to capture errors, failing the workflow explicitly.
Else:
The workflow ends if no qualifying snapshots are found.
See How it Works

Triggering the Runbook
To run this runbook:
1. Locate the Ticket
Find the ticket generated by the above 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

