Delete CloudWatch Alarms in Insufficient State
What It Does
Identifies and deletes CloudWatch Alarms that are in the INSUFFICIENT_DATA
state. These alarms often indicate that metrics are no longer being reported or monitored.
Risk and Scope
Risk Level
Low
AWS Service Targeted
Amazon CloudWatch
Permissions Required
Read Permissions
cloudwatch:DescribeAlarms
Delete Permissions
cloudwatch:DeleteAlarms
These permissions are granted only to the runbook, not to the OneLens platform itself.
Optimization Policies Addressed
This runbook remediates violation tickets triggered by the following policy:
cw_101
Ensure no CloudWatch Alarms are in insufficient state
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
1. Start
Trigger: Initiates the Runbook execution for deleting unused CloudWatch alarms.
2. DescribeAlarms
Action: Executes the DescribeAlarms
API call to retrieve the list of alarms and their current states.
3. If/Else
Condition: Evaluates whether any alarms meet the criteria for further action based on their state.
IsValidForDelete Validates if the filtered alarms meet criteria for deletion.
DeleteAlarms Executes the
DeleteAlarms
API call on the validated alarms.RunScript If no other eligible resource is found, raises a runtime error, failing the workflow explicitly.
Else (no alarms in that state or invalid structure):
Exit through the
Else
path — no further action taken.
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