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

License

Apache-2.0

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.0.0.tar.gz (39.5 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.0.0-py3-none-any.whl (38.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ses_cloudwatch-1.0.0.tar.gz
  • Upload date:
  • Size: 39.5 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.0.0.tar.gz
Algorithm Hash digest
SHA256 5ae09f386ad2bd44df65593b1f50d2b9391d68a67e7131a56af208645218f63f
MD5 ccbde8a99d77ec6bef74b4d2bf7fda99
BLAKE2b-256 0240d6d1fc8427f86550c3f77f9a69500b538b9bbc9d472dfc636c0457193f7f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ses_cloudwatch-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 38.5 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c92b7d1c89e879025d15f3aecf695a05a52917a78f92a8a46c7fdabb53cff4f
MD5 de2f7b0140f5b39d772efc0292d80f61
BLAKE2b-256 1eed93a8eb9314ef895f3cff67488721d7a507ba3d69f563161ee96b07bd53de

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