AWS Security ChangesHomeSearch

AWS sns: SNS large message payloads: MaximumMessageSize up to 1 MiB

Service: sns · 2026-09-27 · Documentation low

File: sns/latest/dg/large-message-payloads.md

Summary

Rewrites the SNS large-message-payloads page to document the topic-level MaximumMessageSize attribute (1,024–1,048,576 bytes), endpoint/subscription restrictions, console/CLI configuration, API behavior, Firehose/SQS/Lambda compatibility, and best practices for dead-letter queues and CloudWatch delivery-failure monitoring.

Security assessment

The change is a feature/limits documentation update for the new MaximumMessageSize attribute; the only security-adjacent content is general reliability guidance to attach a DLQ and alarm on NumberOfNotificationsFailed, which is operational monitoring rather than security or hardening guidance. No vulnerability, CVE, credential, encryption, or access-control change is described.

Evidence

+### Configure dead-letter queues

Diff

diff --git a/sns/latest/dg/large-message-payloads.md b/sns/latest/dg/large-message-payloads.md
index 7b4245ee9..b0cdb4cfd 100644
--- a//sns/latest/dg/large-message-payloads.md
+++ b//sns/latest/dg/large-message-payloads.md
@@ -7 +7 @@
-# Publishing large messages with Amazon SNS and Amazon S3
+How publishing large messages worksSupported configurationSetting MaximumMessageSize on existing topicsConfiguring your topic for large messagesAmazon SNS API reference for large messagesEndpoint compatibilityBest practices
@@ -9 +9 @@
-To publish large Amazon SNS messages, you can use the [Amazon SNS Extended Client Library for Java](https://github.com/awslabs/amazon-sns-java-extended-client-lib/), or the [Amazon SNS Extended Client Library for Python](https://github.com/awslabs/amazon-sns-python-extended-client-lib). These libraries are useful for messages that are larger than the current maximum of 256 KB, with a maximum of 2 GB. Both libraries save the actual payload to an Amazon S3 bucket, and publish the reference of the stored Amazon S3 object to the Amazon SNS topic. Subscribed Amazon SQS queues can use the [Amazon SQS Extended Client Library for Java](https://github.com/awslabs/amazon-sqs-java-extended-client-lib) to de-reference and retrieve payloads from Amazon S3. Other endpoints such as Lambda can use the [Payload Offloading Java Common Library for AWS](https://github.com/awslabs/payload-offloading-java-common-lib-for-aws) to de-reference and retrieve the payload.
+# Publishing large messages with Amazon SNS
@@ -11 +11 @@ To publish large Amazon SNS messages, you can use the [Amazon SNS Extended Clien
-###### Note
+Amazon SNS supports message payloads up to 1 MiB (1,048,576 bytes) when you configure the `MaximumMessageSize` topic attribute. By default, topics accept messages up to 256 KiB. Topics with `MaximumMessageSize` set above 256 KiB support Amazon Data Firehose, Amazon SQS, and AWS Lambda subscriptions, with up to 100 total subscriptions per topic.
@@ -13 +13,119 @@ To publish large Amazon SNS messages, you can use the [Amazon SNS Extended Clien
-The Amazon SNS Extended Client Libraries are compatible with both standard and FIFO topics.
+## How publishing large messages works
+
+You can set the `MaximumMessageSize` topic attribute to any integer value between 1,024 and 1,048,576 bytes. By default, all existing and newly created topics have a `MaximumMessageSize` of 262,144 bytes (256 KiB).
+
+When you publish a message, Amazon SNS validates the combined size of the message body and message attributes against the topic's configured `MaximumMessageSize`. If the combined size exceeds the limit, Amazon SNS returns an `InvalidParameter` error on publish.
+
+## Supported configuration
+
+When you set `MaximumMessageSize` above 256 KiB, Amazon SNS supports the following configuration.
+
+**Subscription limits**
+
+The topic supports up to 100 total subscriptions. If you attempt to create additional subscriptions, Amazon SNS returns an `InvalidParameter` error.
+
+**Supported endpoint types**
+
+Topics with `MaximumMessageSize` above 256 KiB support the following endpoint types:
+
+  * Amazon Data Firehose
+
+  * Amazon SQS
+
+  * AWS Lambda
+
+
+
+
+Topics with `MaximumMessageSize` at 256 KiB or below also support HTTP/HTTPS, SMS, email, email-json, and mobile push (application) endpoints.
+
+## Setting MaximumMessageSize on existing topics
+
+You can increase or decrease a topic's `MaximumMessageSize` at any time. After you change the value, Amazon SNS validates new publish requests against the updated limit.
+
+To set `MaximumMessageSize` above 256 KiB, the topic must have 100 or fewer total subscriptions, all of which must be supported endpoint types (Amazon Data Firehose, Amazon SQS, or AWS Lambda). If the topic has unsupported endpoint types or more than 100 subscriptions, Amazon SNS returns an `InvalidParameter` error.
+
+## Configuring your topic for large messages
+
+### Using the AWS Management Console
+
+###### To configure your topic to publish larger messages
+
+  1. Open the Amazon SNS console at [https://console.aws.amazon.com/sns/home](https://console.aws.amazon.com/sns/home).
+
+  2. In the left navigation pane, choose **Topics**.
+
+  3. Select your topic and choose **Edit**.
+
+  4. Under **Maximum message size** , set your desired limit (up to 1,024 KiB).
+
+  5. Choose **Save changes**.
+
+
+
+
+### Using the AWS CLI
+
+Set `MaximumMessageSize` when creating a new topic:
+    
+    
+    aws sns create-topic \
+        --name my-large-message-topic \
+        --attributes MaximumMessageSize=1048576
+
+Replace `my-large-message-topic` with your topic name and `1048576` with your desired maximum message size in bytes.
+
+Set `MaximumMessageSize` on an existing topic:
+    
+    
+    aws sns set-topic-attributes \
+        --topic-arn arn:aws:sns:us-east-1:123456789012:my-topic \
+        --attribute-name MaximumMessageSize \
+        --attribute-value 1048576
+
+Replace `arn:aws:sns:us-east-1:123456789012:my-topic` with the ARN of your topic and `1048576` with your desired maximum message size in bytes.
+
+Verify your topic's current `MaximumMessageSize`. If the attribute has not been explicitly set, it does not appear in the response, and the topic uses the default of 262,144 bytes (256 KiB).
+    
+    
+    aws sns get-topic-attributes \
+        --topic-arn arn:aws:sns:us-east-1:123456789012:my-topic
+
+## Amazon SNS API reference for large messages
+
+Large message support uses existing Amazon SNS APIs. You don't need new API operations.
+
+API | Change  
+---|---  
+`CreateTopic` | Accepts `MaximumMessageSize` in the `Attributes` parameter. Valid range: 1,024–1,048,576 bytes.  
+`SetTopicAttributes` | Accepts `MaximumMessageSize` as an attribute name.  
+`GetTopicAttributes` | Returns `MaximumMessageSize` if the attribute has been explicitly set. If not returned, the topic uses the default of 262,144 bytes (256 KiB).  
+`Publish` | Validates the combined size of the message body and message attributes against the topic's `MaximumMessageSize`.  
+`PublishBatch` | Validates the combined size of all messages in the batch (each message's body and attributes) against the topic's `MaximumMessageSize`.  
+  
+## Endpoint compatibility
+
+The following list describes how Amazon SNS delivers your large messages to each supported endpoint type.
+
+  * [Amazon Data Firehose](https://docs.aws.amazon.com/firehose/latest/dev/what-is-this-service.html) – Amazon Data Firehose loads streaming data into data stores and analytics services. It supports records up to 1,000 KiB (1,024,000 bytes). The delivered message must stay below this limit. The limit includes Amazon SNS delivery metadata, such as the message ID and timestamp. Messages that exceed the limit fail delivery. A topic's `MaximumMessageSize` can be set up to 1,024 KiB (1,048,576 bytes). For this reason, we recommend that you set a lower `MaximumMessageSize` for topics with Firehose subscriptions. For the current record size limit, see [Amazon Data Firehose quotas](https://docs.aws.amazon.com/firehose/latest/dev/limits.html).
+
+  * [Amazon SQS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/welcome.html) – Amazon SNS can deliver a message to a subscribed Amazon SQS queue up to the Amazon SQS maximum supported message size. The queue's own `MaximumMessageSize` does not apply to messages from Amazon SNS. The Amazon SNS topic's `MaximumMessageSize` is the effective size limit for these messages.
+
+  * [AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/welcome.html) – Amazon SNS invokes AWS Lambda functions asynchronously. AWS Lambda supports asynchronous invocation payloads up to 1 MiB. No additional configuration is required for AWS Lambda subscriptions.
+
+
+
+
+## Best practices
+
+### Configure dead-letter queues
+
+We recommend configuring a dead-letter queue (DLQ) on all subscriptions to handle failed message delivery. A DLQ captures messages that Amazon SNS can't successfully deliver to the subscribed endpoint, allowing you to inspect and reprocess them. For more information, see [Amazon SNS dead-letter queues](./sns-dead-letter-queues.html).
+
+### Monitor with CloudWatch metrics and alarms
+
+Use CloudWatch metrics to monitor message delivery and set alarms on failed deliveries. The `NumberOfNotificationsFailed` metric tracks messages that Amazon SNS can't deliver to subscribed endpoints. Create a CloudWatch alarm on this metric to receive alerts when delivery failures occur. For more information, see [Monitoring Amazon SNS topics using CloudWatch](./sns-monitoring-using-cloudwatch.html).
+
+### Publishing messages larger than 1 MiB with Amazon S3
+
+To publish messages larger than 1 MiB, use the [Amazon SNS Extended Client Library for Java](https://github.com/awslabs/amazon-sns-java-extended-client-lib/) or the [Amazon SNS Extended Client Library for Python](https://github.com/awslabs/amazon-sns-python-extended-client-lib) to store payloads in Amazon S3 and publish a reference through Amazon SNS. These libraries support messages up to 2 GB and are compatible with both Standard and FIFO topics. For instructions on increasing `MaximumMessageSize` before choosing this approach, see Configuring your topic for large messages.