aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.35k stars 3.77k forks source link

SES: Is Firehose supported as an SES EventDestination? #30671

Open zaru opened 1 week ago

zaru commented 1 week ago

Describe the feature

Add support for Amazon Kinesis Firehose as an EventDestination in the SES ConfigurationSet.

Use Case

I need this feature because I am trying to log SES sending events to S3 using Firehose for better data management and analysis. Currently, I can only use CloudWatch and SNS Topics, which limits my ability to efficiently process and store large volumes of email sending data. Having Firehose as an EventDestination would streamline my workflow and improve the overall data handling process.

Proposed Solution

No response

Other Information

const configurationSet = new ses.ConfigurationSet(this, 'SesConfigurationSet', {
  configurationSetName: 'SesConfigurationSet',
});

configurationSet.addEventDestination('EmailDeliveryEventDestination', {
  configurationSetEventDestinationName: 'EmailDeliveryEventDestination',
  destination: ses.EventDestination.firehose(firehoseStream), // I want to configure this
  enabled: true,
  events: [
    ses.EmailSendingEvent.DELIVERY,
    ses.EmailSendingEvent.OPEN,
    ses.EmailSendingEvent.BOUNCE,
    ses.EmailSendingEvent.COMPLAINT,
  ],
})

new ses.EmailIdentity(this, "Identity", {
  identity: identity
  mailFromDomain: domain
  configurationSet: configurationSet
});

Acknowledgements

CDK version used

2.147.1

Environment details (OS name and version, etc.)

macOS 14.5

ashishdhingra commented 1 week ago

Per CfnConfigurationSetEventDestination, kinesisFirehoseDestination is the supported option. However, L2 construct per configuration-set-event-destination doesn't appear to support it.

@zaru Feel free to contribute PR to add support. In the meanwhile, you might need to use L1 construct as a workaround.