Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kamilbiela/cdk-sqs-monitored
AWS CDK SQS Construct with alarms and dead letter queue
https://github.com/kamilbiela/cdk-sqs-monitored
Last synced: 7 days ago
JSON representation
AWS CDK SQS Construct with alarms and dead letter queue
- Host: GitHub
- URL: https://github.com/kamilbiela/cdk-sqs-monitored
- Owner: kamilbiela
- Created: 2020-04-06T20:38:42.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T03:14:16.000Z (almost 2 years ago)
- Last Synced: 2024-10-01T22:54:10.241Z (about 1 month ago)
- Language: TypeScript
- Size: 362 KB
- Stars: 20
- Watchers: 1
- Forks: 3
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-cdk - cdk-sqs-monitored - SQS Construct with dead letter queue and configured alarms. (Construct Libraries / Queue)
- awesome-cdk - cdk-sqs-monitored - SQS Construct with dead letter queue and configured alarms. (Construct Libraries / Queue)
README
AWS CDK SQS Construct with alarms and dead letter queue
What it does
------------
Creates:
- two queues, one main and one dead letter. Dead letter has added suffix "--dead-letter" to name passed in `queueSettings.queueName`
- SNS topic with target configured to email from `alarmEmail` parameter
- alarms for both queues
- for main queue: message age, passed as `alarmWhenMessageOlderThanSeconds` parameter
- for dead letter: alarm triggered if there is any message
Alarms are configured to be sent as fast as possible. Note that SQS report values to CloudWatch every 5 mins.Installation
------------
```bash
npm install --save cdk-sqs-monitored
```Usage
-----Minimal config:
```js
import * as cdk from '@aws-cdk/core';
import * as lib from 'cdk-sqs-monitored';const app = new cdk.App();
export class SampleAppStack extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id, props);
new lib.MonitoredQueue(this, 'q1', {
alarmEmail: '[email protected]',
alarmWhenMessageOlderThanSeconds: 300,
maxReceiveCount: 3,
queueSettings: {
queueName: 'test-queue',
}
})
}
}new SampleAppStack(app, 'SampleappStack');
```queueSettings parameter expects standard @aws-cdk/aws-sqs [QueueProps](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-sqs.QueueProps.html) object
Modyfying and PR
----------------
You're always welcome to create PR, but it might be best solution for you to just fork the repository and apply
the changes in your repo.License
-------
MIT