I am trying to send OTP from my AWS Lambda function hosted in AP-South-1 (i.e. Mumbai) region. I am using a worldwide text-messaging feature of SNS for this. As the "AP-South-1" region does not support worldwide text-messaging feature, I am sending the SNSClient's region endpoint as "APNortheast1" (i.e. Tokyo) region as it supports worldwide text-messaging.
Now, I have given my lambda function administrator privilege (by attaching role with administrator policy). But, still, it doesn't seem to be working (not delivering the message to my mobile). I am not getting any exception while executing the function and I am also getting the "TransactionID" for that SMS. In the SNS console, the SMS is showing as failed. So, I have enabled the cloudwatch log for it. The log I am getting is below-
{
"notification": {
"messageId": "8cba93de-b794-577d-99be-c1ba5d5d21dd",
"timestamp": "2017-10-21 06:26:17.946"
},
"delivery": {
"destination": "+91XXXXXXXXXX",
"smsType": "Transactional",
"providerResponse": "Internal error",
"dwellTimeMs": 79
},
"status": "FAILURE"
}
Now, here is the irony- this is actually a new account where I am migrating (manually) the resources from another account. In this older account, I have the exact same setup, but it seems to be delivering the message properly to my mobile. For your information, my Lambda function is written in the .net core and I am trying to deliver the SMS to an Indian mobile number.