Skip to content

Commit

Permalink
Migrate alarms
Browse files Browse the repository at this point in the history
  • Loading branch information
tomrf1 committed May 30, 2024
1 parent 9c95990 commit 5a001fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 25 deletions.
29 changes: 4 additions & 25 deletions cfn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,6 @@ Resources:
# ****************************************************************************
# Alarms
# ****************************************************************************
FailedRefundAlarm:
Type: AWS::CloudWatch::Alarm
Condition: IsProd
Properties:
AlarmName: "URGENT 9-5 - PROD: Failed to apply refund to Zuora invoice"
AlarmDescription: Urgently perform manual cleanup as documented at https://github.com/guardian/invoicing-api
AlarmActions:
- !Sub arn:aws:sns:${AWS::Region}:${AWS::AccountId}:MarioTest
ComparisonOperator: GreaterThanOrEqualToThreshold
Dimensions:
- Name: FunctionName
Value: !Ref RefundLambda
EvaluationPeriods: 1
MetricName: Errors
Namespace: AWS/Lambda
Period: 300
Statistic: Sum
Threshold: 1
TreatMissingData: notBreaching
DependsOn:
- InvoicingLambdaRole

FailedInvoicesAlarm:
Type: AWS::CloudWatch::Alarm
Expand All @@ -59,7 +38,7 @@ Resources:
- https://github.com/guardian/invoicing-api/blob/main/src/main/scala/com/gu/invoicing/invoice/README.md
- export AWS_DEFAULT_REGION=eu-west-1 && awslogs get --profile membership /aws/lambda/invoicing-api-invoices-PROD --start='DD/mm/yyyy HH:MM' --end='DD/mm/yyyy HH:MM'
AlarmActions:
- !Sub arn:aws:sns:${AWS::Region}:${AWS::AccountId}:MarioTest
- !Sub arn:aws:sns:${AWS::Region}:${AWS::AccountId}:alarms-handler-topic-PROD
ComparisonOperator: GreaterThanOrEqualToThreshold
Dimensions:
- Name: FunctionName
Expand All @@ -84,7 +63,7 @@ Resources:
- https://github.com/guardian/invoicing-api/blob/main/src/main/scala/com/gu/invoicing/pdf/README.md
- export AWS_DEFAULT_REGION=eu-west-1 && awslogs get --profile membership /aws/lambda/invoicing-api-pdf-PROD --start='DD/mm/yyyy HH:MM' --end='DD/mm/yyyy HH:MM'
AlarmActions:
- !Sub arn:aws:sns:${AWS::Region}:${AWS::AccountId}:MarioTest
- !Sub arn:aws:sns:${AWS::Region}:${AWS::AccountId}:alarms-handler-topic-PROD
ComparisonOperator: GreaterThanOrEqualToThreshold
Dimensions:
- Name: FunctionName
Expand All @@ -109,7 +88,7 @@ Resources:
- https://github.com/guardian/invoicing-api/blob/main/src/main/scala/com/gu/invoicing/nextinvoicedate/README.md
- export AWS_DEFAULT_REGION=eu-west-1 && awslogs get --profile membership /aws/lambda/invoicing-api-nextinvoicedate-PROD --start='DD/mm/yyyy HH:MM' --end='DD/mm/yyyy HH:MM'
AlarmActions:
- !Sub arn:aws:sns:${AWS::Region}:${AWS::AccountId}:MarioTest
- !Sub arn:aws:sns:${AWS::Region}:${AWS::AccountId}:alarms-handler-topic-PROD
ComparisonOperator: GreaterThanOrEqualToThreshold
Dimensions:
- Name: FunctionName
Expand All @@ -134,7 +113,7 @@ Resources:
- https://github.com/guardian/invoicing-api/blob/main/src/main/scala/com/gu/invoicing/preview/README.md
- export AWS_DEFAULT_REGION=eu-west-1 && awslogs get --profile membership /aws/lambda/invoicing-api-preview-PROD --start='DD/mm/yyyy HH:MM' --end='DD/mm/yyyy HH:MM'
AlarmActions:
- !Sub arn:aws:sns:${AWS::Region}:${AWS::AccountId}:MarioTest
- !Sub arn:aws:sns:${AWS::Region}:${AWS::AccountId}:alarms-handler-topic-PROD
ComparisonOperator: GreaterThanOrEqualToThreshold
Dimensions:
- Name: FunctionName
Expand Down
4 changes: 4 additions & 0 deletions src/main/scala/com/gu/invoicing/refund/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

## Refund

The refund endpoint is used only by the product-move-api refund lambda.

If the lambda fails, a 5XX is returned and the calling lambda will leave the event on the refund queue.

### Example request

Request
Expand Down

0 comments on commit 5a001fd

Please sign in to comment.