Delete RDS Snapshots older than a specified period of time
Last updated
Deletes manual Amazon RDS snapshots—either DB instance or DB cluster snapshots—that are older than a specified retention period. Outdated snapshots can accumulate over time, leading to unnecessary storage costs. Removing them optimizes storage usage without affecting operational databases.
Risk Level
Low
AWS Service Targeted
Amazon RDS
Delete Permissions
rds:DeleteDBSnapshots
rds:DeleteDBClusterSnapshots
Read Permissions
rds:DescribeDBSnapshots
rds:DescribeDBClusterSnapshots
These permissions are granted only to the runbook, not to the OneLens platform itself.
This runbook remediates violation tickets of the following policy:
rds_31
Manual Aurora cluster snapshots older than a specified period of time 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 outdated manual RDS snapshots.
Action: Runs a script to determine whether the snapshot is a DB instance snapshot or a DB cluster snapshot.
Condition: Checks if the snapshot type is valid.
If the snapshot is both manual and available:
DeleteDBSnapshot
Executes DeleteDBSnapshot for outdated manual instance-level snapshots.
DeleteDBClusterSnapshot
Executes DeleteDBClusterSnapshot for outdated manual cluster-level snapshots.
ThrowError Script raises a runtime error to capture the errors, failing the workflow explicitly.
Else: Terminates workflow if the snapshot type is not supported.

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

