# Set MaximumMessageSize

AWS CLI v2. Confirm the topic has 100 or fewer subscriptions, and that every subscription is SQS, Lambda, or Data Firehose, before you set a value above 262144. Otherwise `SetTopicAttributes` returns `InvalidParameter`.

```bash
aws sns set-topic-attributes \
  --topic-arn arn:aws:sns:us-east-1:123456789012:my-topic \
  --attribute-name MaximumMessageSize \
  --attribute-value 1048576
```

Firehose topics: keep the value under 1024000 bytes. A 1000 KiB Firehose record includes SNS metadata (message id and timestamp). 1048576 can publish a body Firehose then rejects.

If `get-topic-attributes` omits `MaximumMessageSize`, the topic is still at the default of 262144 bytes.

```bash
aws sns get-topic-attributes \
  --topic-arn arn:aws:sns:us-east-1:123456789012:my-topic \
  --query 'Attributes.MaximumMessageSize'
```

Source: https://docs.aws.amazon.com/sns/latest/dg/large-message-payloads.html (behavior) and https://aws.amazon.com/sns/pricing/ (16-request example, fetched 23 Sep 2026).
