Skip to content

ConfigurationSetEventDestination

Source: src/AWS/SES/ConfigurationSetEventDestination.ts

An event destination on an SES v2 configuration set — streams send/delivery/bounce/complaint (and open/click) events to SNS, EventBridge, or CloudWatch.

Publish Bounce and Complaint Events to SNS

import * as SES from "alchemy/AWS/SES";
import * as SNS from "alchemy/AWS/SNS";
const topic = yield* SNS.Topic("EmailEvents", {});
const configSet = yield* SES.ConfigurationSet("Default", {});
const destination = yield* SES.ConfigurationSetEventDestination("ToSns", {
configurationSetName: configSet.configurationSetName,
matchingEventTypes: ["BOUNCE", "COMPLAINT"],
snsDestination: { topicArn: topic.topicArn },
});

Publish Metrics to CloudWatch

const metrics = yield* SES.ConfigurationSetEventDestination("Metrics", {
configurationSetName: configSet.configurationSetName,
matchingEventTypes: ["SEND", "DELIVERY"],
cloudWatchDestination: {
dimensionConfigurations: [
{
dimensionName: "campaign",
dimensionValueSource: "MESSAGE_TAG",
defaultDimensionValue: "none",
},
],
},
});