Last active
November 27, 2019 15:56
-
-
Save rfpedrosa/7fee2cd1dd82c6ceacadbc1fed26fcd1 to your computer and use it in GitHub Desktop.
MyFunction-cloudformation-template.json (FunctionErrorAlarm)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "AWSTemplateFormatVersion":"2010-09-09", | |
| "Description":"Lambda resource stack creation using Amplify CLI", | |
| "Parameters":{ | |
| ... | |
| }, | |
| "Conditions":{ | |
| ... | |
| }, | |
| "Resources":{ | |
| ... | |
| "FunctionErrorAlarm":{ | |
| "Type":"AWS::CloudWatch::Alarm", | |
| "DependsOn":[ | |
| "LambdaFunction", | |
| "LogGroup" | |
| ], | |
| "Properties":{ | |
| "AlarmActions":[ | |
| { | |
| "Ref":"monitoringTopicsAlarmsTopicArn" | |
| } | |
| ], | |
| "AlarmDescription":"Alarm if lambda outputs errors out too many times", | |
| "AlarmName":{ | |
| "Fn::Join":[ | |
| "", | |
| [ | |
| { | |
| "Ref":"LambdaFunction" | |
| }, | |
| "-function-errors" | |
| ] | |
| ] | |
| }, | |
| "ComparisonOperator":"GreaterThanThreshold", | |
| "EvaluationPeriods":1, | |
| "InsufficientDataActions":[ | |
| { | |
| "Ref":"monitoringTopicsAlarmsTopicArn" | |
| } | |
| ], | |
| "MetricName":{ | |
| "Fn::Join":[ | |
| "", | |
| [ | |
| { | |
| "Ref":"LogGroup" | |
| }, | |
| "-ErrorCount" | |
| ] | |
| ] | |
| }, | |
| "Namespace":"MyNamespace/LogMetrics", | |
| "OKActions":[ | |
| { | |
| "Ref":"monitoringTopicsAlarmsTopicArn" | |
| } | |
| ], | |
| "Period":60, | |
| "Statistic":"Sum", | |
| "Threshold":0, | |
| "TreatMissingData":"notBreaching" | |
| } | |
| } | |
| }, | |
| "Outputs":{ | |
| ... | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment