Skip to content

Commit

Permalink
add alarm for api gw latency
Browse files Browse the repository at this point in the history
  • Loading branch information
devksingh4 committed Oct 11, 2023
1 parent 6cedc5d commit 0610eab
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cloudformation/lambda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,25 @@ Resources:
CertificateArn: !Ref ApiCertificateArn
StageName: default

MembershipApiGatewayLatencyAlarm:
Type: 'AWS::CloudWatch::Alarm'
Condition: IsProd
Properties:
AlarmName: !Sub '${MembershipApiGWName}-alarm'
AlarmDescription: !Sub 'Alarm if ${MembershipApiGWName} API gateway errors are detected.'
Namespace: 'AWS/ApiGateway'
MetricName: 'Latency'
Statistic: 'Average'
Period: '60'
EvaluationPeriods: '1'
ComparisonOperator: 'GreaterThanThreshold'
Threshold: '2000'
AlarmActions:
- !Ref AlertSNSArn
Dimensions:
- Name: 'ApiName'
Value: !Ref MembershipApiGWName

APILambdaPermission:
Type: AWS::Lambda::Permission
Properties:
Expand Down

0 comments on commit 0610eab

Please sign in to comment.