Amazon Cognito isn't delivering MFA text messages to my app's users. How do I troubleshoot this?

Last updated: 2019-04-22

When the users in my Amazon Cognito user pool sign in to my app, they don't receive a multi-factor authentication (MFA) text message with their one-time password (OTP) as expected. What's going on?

Short Description

Amazon Cognito's MFA SMS (text) messages are sent with Amazon Simple Notification Service (Amazon SNS). When SMS messages from Amazon SNS aren't sending as expected, you can troubleshoot the delivery failure reason using Amazon CloudWatch Logs.

Resolution

If you haven't already done so, first enable CloudWatch Logs for your SMS messages. Then, follow these instructions.

Review delivery logs using CloudWatch

Check the provider response logs of your SMS deliveries in the CloudWatch console. In each delivery status log, the providerResponse attribute contains the reason for delivery success or failure.

Note: If you just now enabled CloudWatch Logs for SMS messages, you won't see logs of your past SMS usage from before you enabled logging.

As a test, you can send an SMS message via Amazon SNS to your own mobile phone. If the test message doesn't arrive, check the logs for the provider response.

View your month-to-date SMS spending

Look at your Amazon SNS metrics to see your month-to-date SMS spending.

  1. Open the CloudWatch console.
  2. In the left navigation pane, choose Metrics.
  3. Under All metrics, choose SNS, and then choose Metrics with no dimensions.
  4. Under Metric Name, expand SMSMonthToDateSpentUSD, and then choose Graph this metric only.
    Note: On the Graphed metrics tab, confirm that Statistic is set to Maximum. For more information, see the description of SMSMonthToDateSpentUSD in Amazon SNS Metrics.
  5. In the graph, note the value of the metric.

Note: For more information, see Access CloudWatch Metrics for Amazon SNS and Graphing a Metric.

Check your monthly SMS spend limit

Look at your account's SMS monthly spend limit and compare it to your month-to-date SMS spending to determine if you've hit the limit.

  1. Open the Amazon SNS console.
  2. In the left navigation pane, choose Text messaging (SMS).
  3. Under Text messaging preferences, note the value for Account spend limit.

Note: For more information, see Setting SMS Messaging Preferences.

(Optional) Request a spending limit increase

If your account hit the monthly SMS spend limit but you want to send more SMS messages, request a spending limit increase. If you expect your monthly SMS usage to stay the same (or increase) going forward, a limit increase will also prevent the issue from happening again.

Avoid hitting the monthly SMS spend limit again

In addition to requesting a spending limit increase, you can also do the following: