I have a alarm looking for error
message in logs and it does trigger alarm state. But it doesn't get reset and remains in In Alarm
state. I have the alarm action as SNS topic which in turn triggers email. So basically after first error I don't see any subsequent email. What's going wrong with the following template config?
"AppErrorMetric": {
"Type": "AWS::Logs::MetricFilter",
"Properties": {
"LogGroupName": {
"Ref": "AppServerLG"
},
"FilterPattern": "[error]",
"MetricTransformations": [
{
"MetricValue": "1",
"MetricNamespace": {
"Fn::Join": [
"",
[
{
"Ref": "ApplicationEndpoint"
},
"/metrics/AppError"
]
]
},
"MetricName": "AppError"
}
]
}
},
"AppErrorAlarm": {
"Type": "AWS::CloudWatch::Alarm",
"Properties": {
"ActionsEnabled": "true",
"AlarmName": {
"Fn::Join": [
"",
[
{
"Ref": "AppId"
},
",",
{
"Ref": "AppServerAG"
},
":",
"AppError",
",",
"MINOR"
]
]
},
"AlarmDescription": {
"Fn::Join": [
"",
[
"service is throwing error. Please check logs.",
{
"Ref": "AppServerAG"
},
"-",
{
"Ref": "AppId"
}
]
]
},
"MetricName": "AppError",
"Namespace": {
"Fn::Join": [
"",
[
{
"Ref": "ApplicationEndpoint"
},
"metrics/AppError"
]
]
},
"Statistic": "Sum",
"Period": "300",
"EvaluationPeriods": "1",
"Threshold": "1",
"AlarmActions": [{
"Fn::GetAtt": [
"VPCInfo",
"SNSTopic"
]
}],
"ComparisonOperator": "GreaterThanOrEqualToThreshold"
}
}