Skip to main content

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

npm install --save cdk-sqs-monitored

Usage

Minimal config:

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: 'your-email@test.com',
          alarmWhenMessageOlderThanSeconds: 300,
          maxReceiveCount: 3,
          queueSettings: {
              queueName: 'test-queue',
          }
      })
  }
}

new SampleAppStack(app, 'SampleappStack');

queueSettings parameter expects standard @aws-cdk/aws-sqs QueueProps 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

Metadata

Release files for cdk-sqs-monitored 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cdk-sqs-monitored 1.0.3
File Size Uploaded
cdk-sqs-monitored-1.0.3.tar.gz 18.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cdk-sqs-monitored 1.0.3
File Interpreter ABI Platform
cdk_sqs_monitored-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 36.3 kB

Release files / cdk-sqs-monitored-1.0.3.tar.gz

Download URL cdk-sqs-monitored-1.0.3.tar.gz
Size 18.0 kB
Tags Source
SHA-256 checksum
How to use checksums
71683352cd971b96662e5bd01963fe907fc3b1b3a1f0a795353b54138a8b2fcd
BLAKE2b-256 checksum
How to use checksums
a6d63a0ce72af7e888a62d21e7b50391ce207f5da9dc28533679753188105d69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

Release files / cdk_sqs_monitored-1.0.3-py3-none-any.whl

Download URL cdk_sqs_monitored-1.0.3-py3-none-any.whl
Size 18.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ae43195c29f19943e5b7c64ea6b06d370327e9554176321fe0384cfeaa2c60d
BLAKE2b-256 checksum
How to use checksums
3d9561010090df6e9fbb1dad81f82020e3096f0acaf937ed0f85fdd1241d632e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page