Skip to content

Commit 8ae6bdb

Browse files
dsotirho-ucscachave11-ucsc
authored andcommitted
Fix clam_fail metric alarm (#3895)
1 parent 252eaa1 commit 8ae6bdb

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

terraform/shared/shared.tf.json.template.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -565,22 +565,24 @@ def paren(s: str) -> str:
565565
for a in cis_alarms
566566
},
567567
**{
568-
'clam_fail': {
569-
'alarm_name': config.qualified_resource_name('clam_fail', suffix='.alarm'),
568+
resource_name: {
569+
'alarm_name': config.qualified_resource_name(resource_name, suffix='.alarm'),
570570
'comparison_operator': 'GreaterThanOrEqualToThreshold',
571571
'evaluation_periods': 1,
572-
'metric_name': 'clam_fail',
572+
'metric_name': config.qualified_resource_name(resource_name),
573573
'namespace': 'LogMetrics',
574574
'statistic': 'Sum',
575575
'treat_missing_data': 'notBreaching',
576576
'threshold': 1,
577+
'period': period,
578+
'alarm_actions': ['${aws_sns_topic.monitoring.arn}'],
579+
'ok_actions': ['${aws_sns_topic.monitoring.arn}']
580+
} for resource_name, period in [
577581
# With ClamScan running twice a day we've got a 12h period,
578582
# plus 8h upper bound on running time, minus 2h lower bound
579583
# on running time, giving us an 18h evaluation period.
580-
'period': 18 * 60 * 60,
581-
'alarm_actions': ['${aws_sns_topic.monitoring.arn}'],
582-
'ok_actions': ['${aws_sns_topic.monitoring.arn}']
583-
}
584+
('clam_fail', 18 * 60 * 60)
585+
]
584586
},
585587
**{
586588
resource_name: {

0 commit comments

Comments
 (0)