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.sesevents) - Configuration Set Event Destination that sends
SENDevents 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ses_cloudwatch-0.0.0.tar.gz.
File metadata
- Download URL: ses_cloudwatch-0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c04b125f97aa13afe165a4d4f4505b240462d8cfb4e65eb01c0aa18614b2e1b
|
|
| MD5 |
2f95cd88f19ff1db4da670b2db5ff9d9
|
|
| BLAKE2b-256 |
c5be1c8737663adbe39b272bdcaf793d548c1659d0826b8cf4bc2405a811b559
|
File details
Details for the file ses_cloudwatch-0.0.0-py3-none-any.whl.
File metadata
- Download URL: ses_cloudwatch-0.0.0-py3-none-any.whl
- Upload date:
- Size: 38.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbea2b65089f10fac2736ef07202d1282a892f5ee81ccd6bf4a33413d12d2ac2
|
|
| MD5 |
8ea2e3fa8fff7b7b84a12822f8383fa8
|
|
| BLAKE2b-256 |
8c328961736b3eef5293e49bda9a9678f29b12790ff735632d9da0a5ff23f357
|