Skip to main content

AWS CDK SQS Construct with alarms and dead letter queue

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cdk-sqs-monitored-1.0.3.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

cdk_sqs_monitored-1.0.3-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file cdk-sqs-monitored-1.0.3.tar.gz.

File metadata

  • Download URL: cdk-sqs-monitored-1.0.3.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for cdk-sqs-monitored-1.0.3.tar.gz
Algorithm Hash digest
SHA256 71683352cd971b96662e5bd01963fe907fc3b1b3a1f0a795353b54138a8b2fcd
MD5 3fcb50c77f9bba6f0cd303f7a640fe8d
BLAKE2b-256 a6d63a0ce72af7e888a62d21e7b50391ce207f5da9dc28533679753188105d69

See more details on using hashes here.

File details

Details for the file cdk_sqs_monitored-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: cdk_sqs_monitored-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for cdk_sqs_monitored-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5ae43195c29f19943e5b7c64ea6b06d370327e9554176321fe0384cfeaa2c60d
MD5 170f2becae6183674e2c18941feb9098
BLAKE2b-256 3d9561010090df6e9fbb1dad81f82020e3096f0acaf937ed0f85fdd1241d632e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page