Alerts for SES identity bounce notifications

I want to share a snippet of my CDK TypeScript code that sets up an SES identity and SNS topic:

  toolsAccountSES = new EmailIdentity(this, 'ToolsSESidentity', {
    identity: Identity.publicHostedZone(hostedZone),
  });

  // configuring bounce notifications
  const bounceTopic = new Topic(this, `ses-bounce-${props.branchName}`, {
    topicName: `ses-bounce-${props.branchName}`,
    displayName: `SES bounce notifications for ${props.branchName}`,
  });

  bounceTopic.addSubscription(new EmailSubscription(bounceEmail))

Is there any way to link this topic to the identity for receiving bounce notifications? I have been unable to find a solution in CDK

UPDATE: Implementation of a possible fix

I have developed a construct that handles the creation of the configuration set

export class sesConfig extends Construct {
  public configurationSet: ConfigurationSet;

  constructor(scope: Construct, id: string) {
    super(scope, id);

    const bounceTopic = new Topic(this, 'bounce-topic');
    bounceTopic.addSubscription(new EmailSubscription(bounceEmail));

    this.configurationSet = new ConfigurationSet(this, 'ses-config');

    this.configurationSet.addEventDestination('bounce-destination', {
      destination: EventDestination.snsTopic(bounceTopic),
      events: [EmailSendingEvent.BOUNCE],
    });
;
  }
}

Then, I provide this construct to the constructor when creating the email identity

    new EmailIdentity(scope, 'SubdomainIdentity', {
      identity: Identity.publicHostedZone(hostedZone),
      configurationSet: new sesConfig(scope, 'ses-config').configurationSet, 
    });

An email identity is successfully created along with the SNS topic, but upon checking the console, no notification is configured

https://i.sstatic.net/YX3Hx.png

Answer №1

Enhance your EmailIdentity construct by including a configurationSet prop. This allows you to group together rules that will be applied to the identity. Create an instance of the ConfigurationSet construct and then add a ConfigurationSetEventDestination using the addEventDestination method. Customize your destination to utilize your SNS topic for specific events such as BOUNCE or COMPLAINT.

For more information, refer to the CloudFormation documentation for AWS::SES::ConfigurationSet and AWS::SES::ConfigurationSetEventDestination. Additionally, check out the Amazon SES blog post titled Amazon SES – Set up notifications for bounces and complaints for insights on Configuration Sets.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Mapping JSON data from an array with multiple properties

Here is a JSON object that I have: obj = { "api": "1.0.0", "info": { "title": "Events", "version": "v1", "description": "Set of events" }, "topics": { "cust.created.v1": { "subscribe": { ...

Converting Angular object into an array

Is there a way to extract only the data array from the observable response? I'm interested in retrieving the values of cat_id, cat_name, and cat_description, but not the sql_types array. { "code": 0, "message": "" ...

Unable to adjust the x-axis time display in Chart.js

Within my ChartData Component, I am fetching data from an API and displaying it through a chart. The crucial aspect here is the determine Format Logic, which determines the time format of the data. My main challenge lies in changing the time display when s ...

Typescript question: What is the specific error type associated with the 'throw' function in express-validator?

I am trying to identify the type of error thrown by this function: validationResult(req).throw() This is how the throw function is defined: throw() { if (!this.isEmpty()) { throw Object.assign(new Error(), utils_1.bindAll(this)); } } Here ...

Functionality for communicating components is only operational on a single platform

I am looking to create a service that can notify my components when there are any changes to the 'idCustomer' property. These changes should trigger certain actions in different components. Currently, I am using console.log to check if the change ...

Learn the process of programmatically inserting mat-expansion panels

I need help dynamically adding mat-expansion-panel components to my project. Ideally, I would like to add them when a user triggers a function by clicking a button. The ability to add multiple expansion panels as needed is crucial. My initial attempt invo ...

Discovering all words enclosed by '#' in a string using React TypeScript

Trying to figure out how to extract words between '#' in a given string... For example: const str = `<Table striped bordered hover> <thead> <tr> <th>#project name#</th> <th>#First Name#& ...

Can you explain the significance of the @ symbol in TypeScript/Vue?

I've recently embarked on a new VueJS project and stumbled upon some unfamiliar syntax. I have highlighted the lines with comments below. file(example) : MyModule.vue const storeCompte = namespace("compte") // namespace is based on 'no ...

Jasmine encountered an error while trying to compare the same string: 'Expected the values to match.'

I'm encountering an error message, despite verifying that the strings are identical: Expected { $$state : { status : 1, value : { customerNumber : 'customerNumber', name : 'name', userId : 'buId', customerType : 'ty ...

Using Typescript to declare types for an object that is capable of generating an outcome

If I have an object structured like this let obj = { property1:()=>{ return Date()} // for example, it doesn't have to be a date property2:()=>{ return 1} } Now, I want to convert this to the following type structure { property1: ...

Use Ramda to convert an array of objects into nested objects

As a beginner, please forgive me for asking what may be considered a naive question. I currently have an array of objects const arr = [{id: 1, name: 'Pete'}, {id: 5, name: 'John'}, {id: 3, name: 'Peter'}] and I am looking to ...

Typescript encounters an overload error on the Accumulator argument while using reduce operation

I encountered the following code snippet: const foo = ( fields: { [key: string]: string, } ) => { const { one, two } = Object.values(fields).reduce( (acc, field) => { if (isOne(field)) { return { ...acc, two: [...acc.two, ...

`Express routes in TypeScript`

Recently, I have been following a tutorial on how to build a Node.js app with TypeScript. As part of the tutorial, I attempted to organize my routes by creating a separate route folder and a test.ts file containing the following code: import {Router} fro ...

Guide to displaying the dialogue across the entire application when a button is clicked using React and TypeScript

When clicking on the additem or addbooks button in a React and TypeScript application, I want to display a dialog. The dialog should include a hide button that, when clicked, ensures the dialog will not appear again for the session. Below is the code snip ...

How do React Native proxies differ from vanilla React proxies in their functionality?

Trying to retrieve data from an API running locally on port 5000 of my device, I recalled setting the proxy in package.json when working on React web applications: "proxy": "https://localhost:5000" Attempting to fetch information f ...

Defined interface with specific number of members

I am tasked with creating an interface that has only two members, one of which is optional and both have undefined names. Something like: interface MyInterface { [required: string]: string|number [optional: string]?: string|number } Unfortunately, ...

TypeError: describe is not a function in the Mocha testing framework

Encountering an issue with mocha-typescript throwing an error indicating that describe is not defined. TypeError: mocha_typescript_1.describe is not a function at DatabaseTest.WrongPath (test/database_test.ts:21:9) at Context.<anonymous> ...

Guide to sending a body containing formData inside a key using the fetch API

Whenever I attempt to send an image and a path to the API, it is being sent as [object Object] export async function uploadImageToCDN(image: FormData, directory: string = 'dir'): Promise<any> { const token = await authorizeInApi() const he ...

Performing a search through a string array and updating a specific portion of each string

I am faced with an array containing a long list of Strings, and my goal is to filter out all the strings that begin with 'INSERT ALL' and replace the number inside the parentheses with the string ' NULL' Here is the original array: le ...

Tips on incorporating a child component into a parent component using React and TypeScript

I am trying to conditionally render a child component within a parent component using React and TypeScript. Here is the code I have: const Parent = ({ prop1, prop2 }: { prop1: Prop1, prop2: Prop2; }) => { const isChecked = true; return ( ...