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.0.tar.gz (37.0 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.0-py3-none-any.whl (35.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ses_cloudwatch-1.2.0.tar.gz
  • Upload date:
  • Size: 37.0 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.0.tar.gz
Algorithm Hash digest
SHA256 d680c4fd3394ab28953e925c0c838a89ac16a5d3d84c1fdb8dfd635743661177
MD5 bf360969242ed8ba4e4965582410fae4
BLAKE2b-256 c6172bd891d8b89ef6ac0480e9bd1c5b95c50346eb61dff04e6c67e82561c906

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ses_cloudwatch-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 35.9 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 edbdbdc3f9e4bda3b30703f514f3c512b017f3d6223f899fdee51c2537be8adc
MD5 66353078a1c496c16313fc3cab3db267
BLAKE2b-256 67127db81210cdf5987f4cc3fd1c7685dddf908603c79363866e6afbbe642f32

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