SNS Delivery Policy

Delivery Policy is a configuration mechanism in Amazon SNS that defines how the service handles message delivery attempts when temporary failures occur. It enables fine-grained control over retry behavior for notifications, ensuring that important messages have the best chance of reaching their destinations even during transient issues.

What is an SNS Delivery Policy?

A delivery policy is a JSON document that specifies how AWS SNS should handle message delivery retries when server-side errors occur (such as service unavailability) or when messages cannot be delivered to specific endpoints (like HTTP, Amazon SQS, or AWS Lambda). The policy defines parameters like how many times to retry, how long to wait between attempts, and the backoff strategy to use.

By default, Amazon SNS uses a standard retry policy, but custom delivery policies provide greater flexibility for critical messaging scenarios where delivery assurance is paramount. You can configure delivery policies at both the SNS topic level (applying to all subscriptions) or for individual subscriptions (overriding the topic-level policy).

Key Components of SNS Delivery Policies

Delivery policies contain these essential parameters that control retry behavior:

ParameterDescription
Maximum Delivery AttemptsTotal delivery attempts including initial try
Retry DelayTime before first retry
Maximum DelayUpper limit on time between retries
Backoff FunctionRetry timing pattern
Minimum Delay RetriesInitial retries using minimum delay

How Delivery Policies Work with Email Notifications

When using Amazon SNS to handle Amazon SES feedback notifications (such as bounces, complaints, or delivery confirmations), delivery policies ensure these critical signals aren't lost due to temporary processing issues.

For example, if your system processes bounce notifications to maintain list hygiene, a robust delivery policy ensures that even if your endpoint is temporarily unavailable, SNS will continue retry attempts based on your configuration, preventing the permanent loss of important deliverability data.

The delivery policy works alongside the Amazon SNS Dead-Letter Queue (DLQ) feature, which can capture messages that fail delivery after all retry attempts for later processing or analysis.

Frequently Asked Questions

Can delivery policies prevent message loss entirely?

No, while they significantly reduce the risk of message loss due to temporary issues, they can't guarantee delivery if permanent errors occur or if all retry attempts fail.

Do delivery policies affect SNS pricing?

Yes, additional retry attempts count as message deliveries in the SNS pricing model, so aggressive retry policies may increase costs.

Can I apply different policies to different types of notifications?

Yes, by using different SNS topics or by configuring subscription-level delivery policies that override the topic-level settings.

How do delivery policies interact with SES event publishing?

SES publishes events to SNS once, but the delivery policy controls how SNS delivers those events to your endpoints, providing resilience for your email event processing.

Send Consistent-looking & beautiful emails today!

Email communication is part of your product! Don't let it ruin your user's experience with your brand