Skip to content
This repository was archived by the owner on Jun 16, 2024. It is now read-only.
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions cdk/helpers/queue/helpers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { IQueue } from '@aws-cdk/aws-sqs';

export function alarmEachMessage(queue: IQueue) {
// DLQAlarm:
// Type: AWS::CloudWatch::Alarm
// Properties:
// AlarmDescription: "SQS failed"
// AlarmName: "SQSAlarm"
// Metrics:
// - Expression: "m2-m1"
// Id: "e1"
// Label: "ChangeInAmountVisible"
// ReturnData: true
// - Id: "m1"
// Label: "MessagesVisibleMin"
// MetricStat:
// Metric:
// Dimensions:
// - Name: QueueName
// Value: !GetAtt DLQ.QueueName
// MetricName: ApproximateNumberOfMessagesVisible
// Namespace: "AWS/SQS"
// Period: 300 # evaluate maximum over period of 5 min
// Stat: Minimum
// Unit: Count
// ReturnData: false
// - Id: "m2"
// Label: "MessagesVisibleMax"
// MetricStat:
// Metric:
// Dimensions:
// - Name: QueueName
// Value: !GetAtt DLQ.QueueName
// MetricName: ApproximateNumberOfMessagesVisible
// Namespace: "AWS/SQS"
// Period: 300 # evaluate maximum over period of 5 min
// Stat: Maximum
// Unit: Count
// ReturnData: false
// ComparisonOperator: GreaterThanOrEqualToThreshold
// Threshold: 1
// DatapointsToAlarm: 1
// EvaluationPeriods: 1
}