Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services “属性验证失败”;SNSDestination“;从CloudFormation创建ConfigurationSetEventDestination时_Amazon Web Services_Amazon Cloudformation_Amazon Sns_Amazon Ses_Serverless Framework - Fatal编程技术网

Amazon web services “属性验证失败”;SNSDestination“;从CloudFormation创建ConfigurationSetEventDestination时

Amazon web services “属性验证失败”;SNSDestination“;从CloudFormation创建ConfigurationSetEventDestination时,amazon-web-services,amazon-cloudformation,amazon-sns,amazon-ses,serverless-framework,Amazon Web Services,Amazon Cloudformation,Amazon Sns,Amazon Ses,Serverless Framework,我试图使用创建一个ConfigurationSetEventDestination,但它无法识别值SNSDestination的EventDestination,以下是输出 这里是来自serverless.yml resources: Resources: HandleEmailsEvents: Type: AWS::SNS::Topic Properties: DisplayName: 'Handle emails events (${se

我试图使用创建一个
ConfigurationSetEventDestination
,但它无法识别值
SNSDestination
EventDestination
,以下是输出

这里是来自
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'
下面的文档似乎不可用,但它是带有描述对象的

从控制台创建时,SNS目标也可用

@这是怎么回事

谢谢

PS:我不是唯一一个

[更新]

我试着通过nodejs sdk创建相同的文档,它可以工作,也可以

可能是由无服务器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
});

我也偶然发现了同样的问题,因此到目前为止,不能使用cloudformation将SNS作为事件目的地传递。有关更多信息,请参阅签出注释,其中明确提到了该注释。

如果您使用的是
serverless
框架,我找到了一个解决方案

1-创建资源以在serverless.yml中创建
ConfigurationSet

resources:
  Resources:
    ConfigurationSet:
      Type: 'AWS::SES::ConfigurationSet'
      Properties:
        Name: 'EMAIL_TRACKING'
plugins:
  - serverless-ses-sns
custom:
  snsDestination:
    region: <region> # If absent, self:provider.region will be used
    configurationSet: 'EMAIL_TRACKING'
    topicArn: <topic arn> # If absent, one will be created
    events: # One or more of the following
      - renderingFailure
      - reject
      - bounce
      - send
      - complaint
      - delivery
      - open
      - click
2-安装无服务器ses sns

npm install --save-dev serverless-ses-sns
3-添加到serverless.yml

resources:
  Resources:
    ConfigurationSet:
      Type: 'AWS::SES::ConfigurationSet'
      Properties:
        Name: 'EMAIL_TRACKING'
plugins:
  - serverless-ses-sns
custom:
  snsDestination:
    region: <region> # If absent, self:provider.region will be used
    configurationSet: 'EMAIL_TRACKING'
    topicArn: <topic arn> # If absent, one will be created
    events: # One or more of the following
      - renderingFailure
      - reject
      - bounce
      - send
      - complaint
      - delivery
      - open
      - click
4-最后在serverless.yml中添加配置

resources:
  Resources:
    ConfigurationSet:
      Type: 'AWS::SES::ConfigurationSet'
      Properties:
        Name: 'EMAIL_TRACKING'
plugins:
  - serverless-ses-sns
custom:
  snsDestination:
    region: <region> # If absent, self:provider.region will be used
    configurationSet: 'EMAIL_TRACKING'
    topicArn: <topic arn> # If absent, one will be created
    events: # One or more of the following
      - renderingFailure
      - reject
      - bounce
      - send
      - complaint
      - delivery
      - open
      - click
自定义:
SNS目标:
区域:#如果不存在,将使用self:provider.region
配置集:“电子邮件跟踪”
主题:如果不存在,将创建一个主题
事件:#以下一项或多项
-渲染失败
-拒绝
-弹跳
-发送
-抱怨
-交付
-打开
-点击

我现在遇到了完全相同的问题。你找到解决方案了吗?没有,我最终手动创建并使用密钥名而不是所有内部云渲染。哦,太糟糕了。谢谢你的信息!根据目前的文档,SNS不能成为云信息的目的地。