Я пытаюсь отправить SMS с помощью node.js и через AWS. Я получаю ошибку ниже
originalError:
{ Error: getaddrinfo ENOTFOUND sns.southeast-2.amazonaws.com sns.southeast-2.amazonaws.com:443
at errnoException (dns.js:53:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:95:26)
message: 'getaddrinfo ENOTFOUND sns.southeast-2.amazonaws.com sns.southeast-2.amazonaws.com:443',
code: 'NetworkingError',
errno: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'sns.southeast-2.amazonaws.com',
host: 'sns.southeast-2.amazonaws.com',
port: 443,
region: 'southeast-2',
retryable: true,
time: 2018-08-31T12:35:52.241Z },
время: 2018-08-31T12: 35: 52.241Z}
Мой код ниже ...
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: 'AKIAIUZOX3xxxxxxxxxx',
secretAccessKey: 'xxxxj2t1y22qxxxxxxxxxx2vf6KyFiV7Txxxx',
region: 'southeast-2'
});
var sns = new AWS.SNS();
var SNS_TOPIC_ARN = 'arn:aws:sns:ap-southeast-2:82688246XXXX:xxx';
var to_number = '917980981798';
sns.subscribe({
Protocol: 'sms',
TopicArn: SNS_TOPIC_ARN,
Endpoint: to_number,
Topicowner: '826882469571',
endpoint : '+917980981798'
}, function(error, data) {
if (error) {
console.log("error when subscribe", error);
}
var params = {
TargetArn: SNS_TOPIC_ARN,
Message: 'test message',
//hardcode now
Subject: 'Admin'
};
sns.publish(params, function(err_publish, data) {
if (err_publish) {
console.log('Error sending a message', err_publish);
} else {
console.log('Sent message:', data.MessageId);
}
});
});
Я не получаю SMS. Где я должен измениться? Должен ли я измениться на сервере AWS?