1/What is the code trying to achieve?
I am trying to integrate my DLT-registered Sender ID, Entity ID, and Template ID with AWS SNS and Cognito in India to send OTP SMS for user authentication and MFA for my application. The goal is to use the approved IDs for cost-effective and compliant SMS delivery via Cognito's built-in SNS integration.
2/What is the expected behavior I am looking for?
I expect that when a user signs up or logs in via Cognito, the OTP SMS sent for authentication and MFA will use the DLT-registered Sender ID and follow the correct template and entity compliance set by TRAI in India.
3/What is the problem I am encountering?
I’m able to send SMS directly using SNS with the Sender ID, Entity ID, and Template ID when publishing to a phone number. However, when I try to send the same SMS via an SNS Topic or when Cognito triggers an SMS through its default flow, the message is not delivered. It shows "phone carrier blocked." But using the same attributes (Sender ID, Entity ID, Template ID) directly with the SDK and SNS Publish Messaging method works fine for individual phone numbers.
4/What are the things I have tried?
Created an SNS Topic and tried sending messages with the Sender ID, Entity ID, and Template ID in the MessageAttributes field, but messages are not delivered when sending via the SNS Topic.
Directly using the AWS SDK for SNS to publish SMS messages to a phone number works when I include the Sender ID, Entity ID, and Template ID. If any of these IDs are missing, the message fails.
Created a case in AWS for registering my Sender ID, which was approved by AWS for sending SMS in India.
5/What is my current diagnosis?
It seems there is an issue when sending messages through an SNS Topic—the same Sender ID and Template ID that work with direct SMS publishing do not work with Topics. Since Cognito relies on SNS Topics for SMS, this issue prevents us from linking the DLT system to Cognito for OTP SMS.
6/What is the help I require?
I need guidance on how to:
Correctly configure the SNS Topic to use the approved Sender ID, Entity ID, and Template ID when sending SMS in India.
Integrate Cognito with SNS so that all OTP SMS for MFA and authentication comply with DLT regulations and use the registered IDs.
How can I ensure that messages sent through SNS Topics (or via Cognito) use the correct DLT configurations to avoid phone carrier blocking?