Skip to main content

ses-cloudwatch

Project description

ses-cloudwatch

Small CDK construct that routes Amazon SES sending events to a CloudWatch LogGroup through EventBridge. It creates:

  • CloudWatch LogGroup (optionally named)
  • SES Configuration Set (optionally named)
  • EventBridge Rule (matches all aws.ses events)
  • Configuration Set Event Destination that sends SEND events to the default EventBridge bus which the rule targets to the LogGroup

Install

Add as a dependency to your CDK app (peer deps aws-cdk-lib and constructs must already be present at compatible versions):

npm install ses-cloudwatch

Usage

import { Stack } from 'aws-cdk-lib';
import { SesCloudWatch } from 'ses-cloudwatch';

class MyStack extends Stack {
	constructor(scope: Construct, id: string) {
		super(scope, id);

		new SesCloudWatch(this, 'SesEvents');
	}
}

With custom names

new SesCloudWatch(this, 'SesEvents', {
	logGroupName: 'my-ses-event-logs',
	configurationSetName: 'marketing-emails',
	eventRuleName: 'marketing-emails-events',
});

Capturing additional SES events

By default only SEND events are forwarded. Supply the events prop to include more:

import { aws_ses as ses } from 'aws-cdk-lib';

new SesCloudWatch(this, 'SesEvents', {
	events: [
		ses.EmailSendingEvent.SEND,
		ses.EmailSendingEvent.REJECT,
		ses.EmailSendingEvent.DELIVERY,
	],
});

Props

Name Type Default Description
logGroupName string? auto-generated by CloudFormation Explicit name for the CloudWatch LogGroup that stores SES events.
configurationSetName string? <stackName>-ses-config-set Name for the SES Configuration Set whose events are logged.
eventRuleName string? <stackName>-ses-event-rule Name for the EventBridge Rule that matches SES events.
events ses.EmailSendingEvent[]? [ses.EmailSendingEvent.SEND] Set of SES sending event types to capture.

Testing

Run the Jest tests (auto-generated by projen) which validate both default and custom prop behavior:

npm test

Contributing & Build

To set up this repository for development or contribution:

  1. Install dependencies:

    yarn install
    
  2. Synthesize project files (if needed):

    npx projen
    
  3. Build the project:

    yarn build
    
  4. Run tests:

    yarn test
    

Note: Always run yarn install before npx projen to ensure all required packages are available locally.

License

MIT © Merapar Technologies Group B.V.

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

ses_cloudwatch-1.1.0.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ses_cloudwatch-1.1.0-py3-none-any.whl (35.1 kB view details)

Uploaded Python 3

File details

Details for the file ses_cloudwatch-1.1.0.tar.gz.

File metadata

  • Download URL: ses_cloudwatch-1.1.0.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ses_cloudwatch-1.1.0.tar.gz
Algorithm Hash digest
SHA256 1ecf7c886ca5c5e86078407502d47d5a6c11309d20b9b462bd385a85476eaa91
MD5 c94185d42a7be94ef12a71ccec294dc3
BLAKE2b-256 593d6b69f028de2bf49d418b0c75bb383782b6e4c74927fd6d2a5e32da6e20fc

See more details on using hashes here.

File details

Details for the file ses_cloudwatch-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: ses_cloudwatch-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ses_cloudwatch-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8f0d341d30a8a3b7910d9959c3ed9a9f2afd4b9aee8259aee66c4b3dd4937c37
MD5 b8c6841d4f3512ac99cf3f5b4860a7f3
BLAKE2b-256 c6fe95cecd4e10387ffa918597151d1b604b2f4703340c013aab97f82697be66

See more details on using hashes here.

Supported by

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