Last active
May 14, 2018 14:35
-
-
Save knil-sama/e0fdd159a4c384601d1293f7b91eb2ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| import sys | |
| prefix = sys.argv[1] | |
| client = boto3.client('cloudwatch',region_name='eu-west-1') | |
| response = client.describe_alarms( | |
| AlarmNamePrefix = prefix, | |
| StateValue = 'INSUFFICIENT_DATA', | |
| ) | |
| alarms = response['MetricAlarms'] | |
| alarm_names = [alarm['AlarmName'] for alarm in alarms] | |
| print alarm_names[0] | |
| response1 = client.delete_alarms( | |
| AlarmNames = alarm_names | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment