jogold / cloudstructs

High-level constructs for AWS CDK
Apache License 2.0
167 stars 14 forks source link

feat(email-receiver): Lambda function receives SNS event #262

Closed jogold closed 8 months ago

jogold commented 8 months ago

The Lambda function now receives a SNS event containing the SES event.

Use the following code to get the SES event:

export async function handler(event: AWSLambda.SNSEvent): Promise<void> {
  const ses = JSON.parse(event.Records[0].Sns.Message) as AWSLambda.SESMessage;
}

This removes a intermediary Lambda function that had an EventBridge destination, simplifying the architecture.

BREAKING CHANGE: The Lambda function of an EmailReceiver now receives a SNS event.