Skip to content

Instantly share code, notes, and snippets.

@mshakhomirov
Created April 13, 2023 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mshakhomirov/0bf21eacfc8dbe3de4880044c16976f8 to your computer and use it in GitHub Desktop.
Save mshakhomirov/0bf21eacfc8dbe3de4880044c16976f8 to your computer and use it in GitHub Desktop.
AlarmNotificationTopic:
Type: AWS::SNS::Topic
Properties:
Subscription:
- Endpoint:
Ref: Email
Protocol: email
PipelineManagerLambdaLogGroup:
DeletionPolicy: Delete
Type: AWS::Logs::LogGroup
Properties:
RetentionInDays: 7
LogGroupName: /aws/lambda/pipeline-manager
PipelineManagerLambdaERRORMetricFilter:
Type: 'AWS::Logs::MetricFilter'
DependsOn: PipelineManagerLambdaLogGroup
Properties:
LogGroupName: /aws/lambda/pipeline-manager
FilterPattern: ?ERROR ?Error ?error ?undefined
MetricTransformations:
- MetricValue: '1'
MetricNamespace: pipeline-manager # !Ref ServiceName
MetricName: ERRORCount
PipelineManagerLambdaERRORMetricAlarm:
Type: 'AWS::CloudWatch::Alarm'
DependsOn: PipelineManagerLambdaERRORMetricFilter
Properties:
AlarmDescription: Trigger a the number ERROR greater than 5 for 5 consecutive minutes.
Namespace: pipeline-manager # !Ref ServiceName
MetricName: ERRORCount
Statistic: Sum
Period: '60'
EvaluationPeriods: '5'
ComparisonOperator: GreaterThanThreshold
Threshold: '0'
AlarmActions:
- !Ref AlarmNotificationTopic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment