为某些AWS SES事件创建配置集事件目标时,我遇到此错误。这是我传递给ses.createConfigurationSetEventDestination()的参数:
const destinationParams = {
ConfigurationSetName: instance.id,
EventDestination: {
Name: instance.id,
MatchingEventTypes: ['send', 'reject', 'bounce', 'complaint', 'delivery', 'open', 'click'],
Enabled: true,
SNSDestination: {
TopicARN: topicArn,
},
},
};
我得到的错误是
UnexpectedParameter: Unexpected key 'SNSDestination' found in params.EventDestination
目前的控制流程如下:
答案 0 :(得分:2)
我正在改进我以前的答案:
我配置了node.js sdk并尝试重现该问题。我能够创建ConfigurationSet
并成功设置EventDestination
。
<强>代码:强>
var AWS = require('aws-sdk');
AWS.config.update({region:'us-east-1'});
var ses = new AWS.SES();
/*const params1 = {
ConfigurationSet: {
Name: 'test'
}
};
ses.createConfigurationSet(params1, function(err, data) {
if (err) console.log(err, err.stack);
else console.log(data);
}); */
const destinationParams = {
ConfigurationSetName: 'test',
EventDestination: {
Name: 'testevent',
MatchingEventTypes: ['send', 'reject', 'bounce', 'complaint', 'delivery', 'open', 'click'],
Enabled: true,
SNSDestination: {
TopicARN: 'arn:aws:sns:us-east-1:XXXXXXXXXXX:test',
},
},
};
ses.createConfigurationSetEventDestination(destinationParams, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
<强>响应:强>
{ ResponseMetadata: { RequestId: '838b95ae-af35-11e7-a190-c960102424be' } }
所以node.js sdk没有问题。