从CloudFormation创建ConfigurationSetEventDestination时,属性验证失败“ SNSDestination”

问题描述 投票:3回答:1

我正在尝试使用ConfigurationSetEventDestination创建一个serverless resources,但是它无法识别EventDestination的值SNSDestination,这是输出。

enter image description here

这里是serverless.yml的资源

resources:
  Resources:
    HandleEmailsEvents:
      Type: AWS::SNS::Topic
      Properties:
        DisplayName: 'Handle emails events (${self:custom.stage})'
        TopicName: 'HandleEmailsEvents'
    ConfigurationSet:
      Type: 'AWS::SES::ConfigurationSet'
      Properties:
        Name: 'EMAIL_TRACKING'
    ConfigurationSetEventDestination:
      Type: 'AWS::SES::ConfigurationSetEventDestination'
      Properties:
        ConfigurationSetName: 'EMAIL_TRACKING'
        EventDestination:
          Name: 'EMAIL_TRACKING_DESTINATION'
          Enabled: true
          MatchingEventTypes:
            - bounce
            - complaint
          SNSDestination:
            TopicARN:
              Ref: 'HandleEmailsEvents'

遵循文档ConfigurationSetEventDestination EventDestination似乎不可用,但是herethis描述对象一起使用。

从控制台创建时,SNSDestination也可用

enter image description here

@ AWS这是怎么回事?

谢谢,

PS:我不是唯一的一个...

https://forums.aws.amazon.com/thread.jspa?messageID=858616&#858616

https://forums.aws.amazon.com/thread.jspa?messageID=809004&#809004

https://forums.aws.amazon.com/thread.jspa?messageID=848013&#848013

[UPDATED]

我尝试通过nodejs sdk创建相同的文件,它可以正常工作,可能是文档here

可能与无服务器CloudFormation生成的堆栈有关吗?

let ses = new AWS.SES()
const destinationParams = {
  ConfigurationSetName: 'test',
  EventDestination: {
    Name: 'xxxxx2',
    MatchingEventTypes: ['send', 'reject', 'bounce', 'complaint', 'delivery', 'open', 'click'],
    Enabled: true,
    SNSDestination: {
      TopicARN: 'arn:aws:sns:us-east-1:xxxxxxxxxx:test',
    },
  },
};

ses.createConfigurationSetEventDestination(destinationParams, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

enter image description here

amazon-web-services amazon-cloudformation amazon-sns amazon-ses serverless-framework
1个回答
0
投票

我也偶然发现了同一问题,因此,到目前为止,无法使用cloudformation将SNS作为事件目标传递。有关更多信息,请参考link,请结帐NOTE,此处明确提到了它。

© www.soinside.com 2019 - 2024. All rights reserved.