Skip to content

Commit

Permalink
- Autodated namespace for AlarmSets for ASG
Browse files Browse the repository at this point in the history
  • Loading branch information
gitwater committed Nov 12, 2021
1 parent 9e7bbf8 commit 9b794e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/paco/cftemplates/cw_alarms.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,11 @@ def add_alarms(self, alarms):
alarm_export_dict['Namespace'] = "Paco/" + prefixed_log_group_name
else:
# if not supplied default to the Namespace for the Resource type
alarm_export_dict['Namespace'] = vocabulary.cloudwatch[resource.type]['namespace']
if 'namespace_by_metric_name' in vocabulary.cloudwatch[resource.type].keys() and alarm.metric_name in vocabulary.cloudwatch[resource.type]['namespace_by_metric_name'].keys():
alarm_export_dict['Namespace'] = vocabulary.cloudwatch[resource.type]['namespace_by_metric_name'][alarm.metric_name]
else:
alarm_export_dict['Namespace'] = vocabulary.cloudwatch[resource.type]['namespace']

else:
# Use the Namespace as directly supplied
alarm_export_dict['Namespace'] = alarm.namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ ASG:
classification: health
severity: critical
metric_name: "StatusCheckFailed"
namespace: AWS/EC2
period: 60
evaluation_periods: 5
statistic: Maximum
Expand All @@ -73,7 +72,6 @@ ASG:
classification: performance
severity: critical
metric_name: "CPUUtilization"
namespace: AWS/EC2
period: 60
evaluation_periods: 30
threshold: 90
Expand Down

0 comments on commit 9b794e9

Please sign in to comment.