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.2.1.tar.gz (36.9 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.2.1-py3-none-any.whl (35.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ses_cloudwatch-1.2.1.tar.gz
  • Upload date:
  • Size: 36.9 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.2.1.tar.gz
Algorithm Hash digest
SHA256 08104438a11a5c04d850cd28e8dc03722b6f1672bc8b3290513c330d175b996f
MD5 f6186faf6fb13190ae7643909e6cf8cb
BLAKE2b-256 879cb6c973b1396a40e0a1c176133ecdc07b66737ee84d4cfdcc2606d031c208

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ses_cloudwatch-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 35.8 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.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 15d21ee53c0d00252d6ab07ee493eee3430fa8ff99cfadf1cf9e0574b0d7e3f8
MD5 c228c2370af7178eff5b0069f8b5896d
BLAKE2b-256 c8a6b5f385ada10f72c0bdc0958fc6a68ef8d131cc2d416a9e7a5175c03238fd

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