-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.yaml
More file actions
51 lines (46 loc) · 1.6 KB
/
main.yaml
File metadata and controls
51 lines (46 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: |
FHIR Validator Cloudwatch alarms and related resources
Parameters:
StackName:
Type: String
EnableAlerts:
Type: String
FHIRValidatorUKCoreLambdaName:
Type: String
Resources:
FHIRValidatorErrorLogsMetricFilter:
Type: AWS::Logs::MetricFilter
Properties:
FilterName: FHIRValidatorErrors
# Catch java exceptions
FilterPattern: Exception
LogGroupName:
Fn::ImportValue: !Sub ${StackName}:functions:${FHIRValidatorUKCoreLambdaName}:LambdaLogGroupName
MetricTransformations:
- MetricNamespace: LambdaLogFilterMetrics
MetricName: !Sub ${StackName}FHIRValidatorErrorCount
MetricValue: 1
Unit: Count
FHIRValidatorErrorsAlarm:
Type: AWS::CloudWatch::Alarm
Properties:
AlarmDescription: Count of FHIR Validator system errors
AlarmName: !Sub ${StackName}_FhirValidator_Errors
Namespace: LambdaLogFilterMetrics
MetricName: !Sub ${StackName}FHIRValidatorErrorCount
Period: 60 #seconds
EvaluationPeriods: 1
Statistic: Sum
ComparisonOperator: GreaterThanOrEqualToThreshold
Threshold: 1
Unit: Count
TreatMissingData: notBreaching
ActionsEnabled: !Ref EnableAlerts
AlarmActions:
- !ImportValue account-resources-cdk-uk:SNS:SlackAlertsSnsTopicArn:Arn
InsufficientDataActions:
- !ImportValue account-resources-cdk-uk:SNS:SlackAlertsSnsTopicArn:Arn
OKActions:
- !ImportValue account-resources-cdk-uk:SNS:SlackAlertsSnsTopicArn:Arn