Skip to content

Commit

Permalink
5XX & NoHealthy alarms are in AWS Console, but not codified in cloudf…
Browse files Browse the repository at this point in the history
…ormation. Also changing the 5XX alarm to be ELB rather than backend to catch timeouts etc (unresponsive backend)
  • Loading branch information
twrichards committed Feb 21, 2020
1 parent 1426025 commit 08ccc8d
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions cloudformation/membership-attribute-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,47 @@ Resources:
Unit: Count
ReturnData: false

NoHealthyInstancesAlarm:
Type: AWS::CloudWatch::Alarm
Condition: CreateProdMonitoring
Properties:
AlarmActions:
- !Sub 'arn:aws:sns:${AWS::Region}:${AWS::AccountId}:fulfilment-dev'
AlarmName: !Sub No healthy instances for members-data-api in ${Stage}
MetricName: HealthyHostCount
Namespace: AWS/ELB
Dimensions:
- Name: LoadBalancerName
Value: !Ref LoadBalancer
ComparisonOperator: LessThanOrEqualToThreshold
Threshold: 0.5
Period: 60
EvaluationPeriods: 10
Statistic: Average
DependsOn:
- LoadBalancer

High5XXRateAlarm:
Type: AWS::CloudWatch::Alarm
Condition: CreateProdMonitoring
Properties:
AlarmActions:
- !Sub 'arn:aws:sns:${AWS::Region}:${AWS::AccountId}:fulfilment-dev'
AlarmName: !Sub High 5XX rate for members-data-api in ${Stage}
MetricName: HTTPCode_Target_5XX_Count
Namespace: AWS/ELB
Dimensions:
- Name: LoadBalancerName
Value: !Ref LoadBalancer
ComparisonOperator: GreaterThanOrEqualToThreshold
Threshold: 10
Period: 60
EvaluationPeriods: 1
Statistic: Sum
TreatMissingData: notBreaching
DependsOn:
- LoadBalancer

Outputs:
LoadBalancerUrl:
Value:
Expand Down

0 comments on commit 08ccc8d

Please sign in to comment.