Last active
November 27, 2019 13:58
-
-
Save rfpedrosa/0f1e1a1df82a61b6f3fe3742cbe9caea to your computer and use it in GitHub Desktop.
MyFunction-cloudformation-template.json (just InvocationErrorAlarm)
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":{ | |
| "env":{ | |
| "Type":"String" | |
| }, | |
| "monitoringTopicsAlarmsTopicArn":{ | |
| "Type":"String" | |
| } | |
| }, | |
| "Conditions":{ | |
| ... | |
| }, | |
| "Resources":{ | |
| ... | |
| "InvocationErrorAlarm":{ | |
| "Type":"AWS::CloudWatch::Alarm", | |
| "DependsOn":[ | |
| "LambdaFunction" | |
| ], | |
| "Properties":{ | |
| "AlarmActions":[ | |
| { | |
| "Ref":"monitoringTopicsAlarmsTopicArn" | |
| } | |
| ], | |
| "AlarmDescription":"Alarm if lambda errors out too many times", | |
| "AlarmName":{ | |
| "Fn::Join":[ | |
| "", | |
| [ | |
| { | |
| "Ref":"LambdaFunction" | |
| }, | |
| "-invocation-errors" | |
| ] | |
| ] | |
| }, | |
| "ComparisonOperator":"GreaterThanThreshold", | |
| "Dimensions":[ | |
| { | |
| "Name":"FunctionName", | |
| "Value":{ | |
| "Ref":"LambdaFunction" | |
| } | |
| } | |
| ], | |
| "EvaluationPeriods":1, | |
| "InsufficientDataActions":[ | |
| { | |
| "Ref":"monitoringTopicsAlarmsTopicArn" | |
| } | |
| ], | |
| "MetricName":"Errors", | |
| "Namespace":"AWS/Lambda", | |
| "OKActions":[ | |
| { | |
| "Ref":"monitoringTopicsAlarmsTopicArn" | |
| } | |
| ], | |
| "Period":60, | |
| "Statistic":"Sum", | |
| "Threshold":0, | |
| "TreatMissingData":"notBreaching", | |
| "Unit":"Count" | |
| } | |
| } | |
| }, | |
| "Outputs":{ | |
| ... | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment