Skip to content

Commit

Permalink
add alarms to resume-book api gw
Browse files Browse the repository at this point in the history
  • Loading branch information
devksingh4 committed Oct 11, 2023
1 parent 60a4a48 commit a243a18
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions cloudformation/lambda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,44 @@ Resources:
CertificateArn: !Ref ApiCertificateArn
StageName: default

ResumeBookApiGatewayLatencyAlarm:
Type: 'AWS::CloudWatch::Alarm'
Condition: IsProd
Properties:
AlarmName: !Sub '${ResumeBookApiGWName}-latency-alarm'
AlarmDescription: !Sub 'Alarm if ${ResumeBookApiGWName} API gateway latency is > 2s.'
Namespace: 'AWS/ApiGateway'
MetricName: 'Latency'
Statistic: 'Average'
Period: '60'
EvaluationPeriods: '1'
ComparisonOperator: 'GreaterThanThreshold'
Threshold: '3000'
AlarmActions:
- !Ref AlertSNSArn
Dimensions:
- Name: 'ApiName'
Value: !Ref ResumeBookApiGWName

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

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

0 comments on commit a243a18

Please sign in to comment.