You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在AWS CDK中为SES身份配置退信通知SNS主题?

问题:如何通过CDK TypeScript将SNS主题关联到SES身份以接收退信通知?

以下是我用于创建SES身份和SNS主题的CDK TypeScript代码片段:

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

// 设置退信通知
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))

是否有办法将该主题关联到SES身份以接收退信通知?我在CDK中未找到实现方式。


更新:尝试的解决方案代码

我创建了一个用于生成配置集的Construct:

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],
    });
  }
}

并在创建电子邮件身份时将其传入构造函数:

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

电子邮件身份和SNS主题已成功创建,但在控制台查看该身份时,未显示任何通知设置。

控制台SES身份通知设置空白截图


内容的提问来源于stack exchange,提问作者Comfortably Numb

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.09 12:42:32