Skip to content

Commit

Permalink
chore(cfn): add UnsubscribeAllInactivityAlarm
Browse files Browse the repository at this point in the history
  • Loading branch information
coldlink committed Jul 31, 2024
1 parent 77754d9 commit eaaa60c
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions cloudformation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -790,3 +790,36 @@ Resources:
- !Ref 'TopicSendEmail'
InsufficientDataActions:
- !Ref 'TopicSendEmail'
UnsubscribeAllInactivityAlarm:
Type: AWS::CloudWatch::Alarm
Condition: IsProd
Properties:
AlarmName: !Sub
- '${Priority} - ${App} ${Stage} has had successful no unsubscribe all from email clients in the last hour'
- Priority: !FindInMap [StageVariables, AlarmPriorities, P2]
AlarmDescription: 'No one has successfully unsubscribed all from email clients in the last hour.'
Metrics:
- Id: totalUnsubscribeAllCount
Expression: unsubscribeAllCount
Label: 'Total unsubscribe all'
- Id: unsubscribeAllCount
MetricStat:
Metric:
Namespace: Gateway
MetricName: 'UnsubscribeAll::Success'
Dimensions:
- Name: Stage
Value: !Ref 'Stage'
- Name: ApiMode
Value: identity-gateway
Period: 3600
Stat: Sum
Unit: Count
ReturnData: false
ComparisonOperator: LessThanThreshold
Threshold: 1
EvaluationPeriods: 1
AlarmActions:
- !Ref 'TopicSendEmail'
InsufficientDataActions:
- !Ref 'TopicSendEmail'

0 comments on commit eaaa60c

Please sign in to comment.