AWS SNS
SMS delivery status
cloud computing
message tracking
Amazon Web Services

Getting delivery status of AWS SMS

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

Introduction

In today's connected world, promptly monitoring the delivery status of SMS messages is crucial for applications built on Amazon Web Services (AWS). AWS Simple Notification Service (SNS) provides a flexible method for sending SMS messages globally. One significant feature of AWS SNS is its capability to report the delivery status of each message sent, which becomes vital for tracking and troubleshooting any communication issues.

Understanding AWS SMS Delivery Status

AWS SNS allows you to track message delivery status by sending events to Amazon CloudWatch, Amazon Kinesis Data Fireshose, or AWS Lambda. These events include information such as whether a message was successfully delivered or if it encountered any errors.

SNS Delivery Status Configuration

To receive delivery status notifications, you must configure your SNS topic to enable the feature:

  1. Create an SNS Topic:
    • You first need to create an SNS topic that you will use to publish your SMS message.
  2. Enable Delivery Status Logging:
    • Go to the SNS console.
    • Select your SNS topic.
    • In the "Delivery Status" section, choose your delivery log endpoint (CloudWatch, Kinesis Data Firehose, or Lambda) and enable logging for the SMS platform.
  3. Configure Permissions:
    • Make sure the SNS topic has the appropriate permissions to publish status logs to the endpoint you selected. For CloudWatch, ensure the SNS topic has the `cloudwatch:PutMetricData` policy attached.

Example SNS Message Delivery Status

Below is an example of a delivery status JSON notification for an SNS message:

  • `status`: The end result of the delivery attempt (e.g., "SUCCESS", "FAILED").
  • `destination`: The phone number to which the message was sent.
  • `providerResponse`: A description from the carrier or AWS SNS.
  • `dwellTimeMs`: Time in milliseconds SNS took until it sent the message to the delivery provider.
  • `dwellTimeMsUntilDeviceAck`: Time in milliseconds from the message being sent to the provider and the provider acknowledging the delivery.
  • Set up CloudWatch Alarms:
  • Generate Insights:
  • Automatic Retries and Notifications:
  • Incorrect Permissions:
  • Telephone Provider Errors:
  • Configuration Errors:

Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

All Rights Reserved.