{"id":20917,"library":"amazon-sns-extended-client","title":"Amazon SNS Extended Client Library for Python","description":"Python version of AWS SNS extended client that enables publishing large payload messages (>256KB) via Amazon S3. Current version 1.0.1, release cadence is low (latest release Jan 2022).","status":"active","version":"1.0.1","language":"python","source_language":"en","source_url":"https://github.com/awslabs/amazon-sns-python-extended-client-lib","tags":["AWS","SNS","S3","large payload","extended client"],"install":[{"cmd":"pip install amazon-sns-extended-client","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"AWS SDK for Python required for SNS and S3 operations","package":"boto3","optional":false},{"reason":"Optional dependency for payload encryption","package":"aws-encryption-sdk","optional":true}],"imports":[{"note":"Wrong package name: the correct import uses dashes converted to underscores in the module path.","wrong":"from sns_extended_client import SNSExtendedClient","symbol":"SNSExtendedClient","correct":"from amazon_sns_extended_client import SNSExtendedClient"},{"symbol":"SNSMessageSizeChecker","correct":"from amazon_sns_extended_client.sns_message_size_checker import SNSMessageSizeChecker"}],"quickstart":{"code":"import boto3\nfrom amazon_sns_extended_client import SNSExtendedClient\n\ntopic_arn = os.environ.get('TOPIC_ARN', 'arn:aws:sns:us-east-1:123456789012:MyTopic')\nbucket_name = os.environ.get('BUCKET_NAME', 'my-sns-payload-bucket')\n\nsns_client = boto3.client('sns')\ns3_client = boto3.client('s3')\n\nextended_client = SNSExtendedClient(sns_client, s3_client, bucket_name)\nresponse = extended_client.publish(\n    TopicArn=topic_arn,\n    Message='This is a large message that exceeds the 256KB limit if long enough...' * 1000\n)\nprint(response)","lang":"python","description":"Initialize the extended client with SNS and S3 clients and a bucket for payload storage."},"warnings":[{"fix":"Use standard SNS topics only, or manually implement ordering/deduplication.","message":"The library does NOT support FIFO topics - messages are published without message group/deduplication IDs. Attempting to use FIFO topic will cause error.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use SNSMessageSizeChecker to conditionally skip S3 for messages under 256KB.","message":"Payloads are uploaded to S3 as individual objects (one per message). This incurs S3 storage and request costs even for small messages if always routed through extended client.","severity":"gotcha","affected_versions":"all"},{"fix":"Check AWS SDK compatibility; if needed, use AWS SDK v2 or higher with updated config.","message":"The library currently uses the legacy 'PayloadSizeThreshold' parameter in configuration; newer AWS SDK versions may deprecate the client object signature.","severity":"deprecated","affected_versions":"1.0.1"},{"fix":"Ensure bucket and topic are in the same AWS region.","message":"The S3 bucket must be in the same region as the SNS topic, otherwise publish will fail with cross-region access errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use SNSExtendedClient to automatically store large payloads in S3.","cause":"Message size exceeds the SNS limit of 256KB and the extended client is not configured or used.","error":"botocore.exceptions.ClientError: An error occurred (InvalidParameter) when calling the Publish operation: Invalid parameter: Message too long"},{"fix":"Ensure you have installed amazon-sns-extended-client (not sns-extended-client) and import as: from amazon_sns_extended_client import SNSExtendedClient","cause":"Incorrect import path or wrong package version.","error":"ImportError: cannot import name 'SNSExtendedClient' from 'amazon_sns_extended_client'"},{"fix":"Grant s3:PutObject permission on the bucket to the IAM user/role.","cause":"The IAM role or credentials used do not have permission to write to the configured S3 bucket.","error":"botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the PutObject operation: Access Denied"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}