View a markdown version of this page

Amazon SNS email subscriptions end of support in China Regions - Amazon Simple Notification Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Amazon SNS email subscriptions end of support in China Regions

After careful consideration, we have decided to discontinue email subscriptions to Amazon SNS topics in the Amazon China (Beijing) Region, operated by Sinnet and the Amazon China (Ningxia) Region, operated by NWCD, effective June 30, 2027. Amazon SNS will no longer accept new email subscriptions or deliver messages to email endpoints in these Regions after the dates outlined below.

Timeline
Date What to expect
June 30, 2026 Public announcement. All customers are notified.
July 30, 2026 Amazon accounts with no existing email subscriptions in these Regions can no longer add email subscriptions to Amazon SNS topics.
December 31, 2026 All Amazon accounts (including those with existing email subscriptions) can no longer create new email subscriptions to Amazon SNS topics. Existing email subscriptions continue to function.
June 30, 2027 All email subscriptions are deleted. Amazon SNS no longer delivers messages to email endpoints. Customers receive an Amazon Health Notification with a file containing their subscribed email addresses.

Alternative solutions

Amazon does not offer any other email delivery services in the Amazon China (Beijing) Region or the Amazon China (Ningxia) Region. To continue delivering messages to email recipients via Amazon SNS, we recommend subscribing an Amazon Lambda function to your existing Amazon SNS topic that forwards messages to a third-party email service provider operating in China.

You can find third-party email service providers on Amazon Marketplace, such as SendCloud.

Note

Amazon does not endorse or provide support for third-party services. Customers are responsible for evaluating providers based on their requirements for deliverability, compliance, pricing, and regional availability.

To set up a Lambda function that delivers messages to a third-party email provider, follow these steps:

  1. Export your subscribed email addresses. Before June 30, 2027, use the Amazon SNS console or the ListSubscriptionsByTopic API to export the email addresses subscribed to your topics. After June 30, 2027, all email subscriptions will be deleted, and you can retrieve your subscribed email addresses from the Amazon Health Notification sent on that date.

  2. Choose a third-party email provider. Select a provider that meets your requirements. See the list of providers above. Sign up and complete the provider's onboarding process.

  3. Import your recipient list into the provider. Most providers support importing email addresses as a contact list or address list. For example, with SendCloud, you can use the Address List API to create a list and add members programmatically or import via CSV.

  4. Create a Lambda function. Create a Lambda function that receives the Amazon SNS message payload and calls your email provider's API to send the message to your recipient list.

  5. Subscribe the Lambda function to your Amazon SNS topic. Use the Amazon SNS console or the Subscribe API.

  6. Test the end-to-end flow. Publish a test message to your topic and verify email delivery through the provider.

  7. Remove the email subscription. Once migration is confirmed, you can remove the email subscription using the Amazon SNS console or the Unsubscribe API. Any remaining email subscriptions will be automatically deleted on June 30, 2027.

Code example: Lambda function with SendCloud

The following example shows a Lambda function that receives messages from an Amazon SNS topic and sends them as emails using a SendCloud address list.

Prerequisites

  • A SendCloud account with a verified sender domain

  • An address list created in SendCloud containing your recipients (imported from your Amazon SNS email subscriptions)

  • The following Lambda environment variables configured:

    • SENDCLOUD_API_USER: your SendCloud API user

    • SENDCLOUD_API_KEY: your SendCloud API key

    • SENDER_EMAIL: your verified sender email address (e.g., notifications@yourdomain.com)

    • ADDRESS_LIST: your SendCloud address list alias (e.g., mylist@maillist.sendcloud.org)

Note

This simplified example reads credentials from Lambda environment variables. In production, consider storing credentials in Amazon Secrets Manager.

Lambda function (Python)

import json import urllib.request import urllib.parse import os # SendCloud credentials. This simplified example reads them from Lambda # environment variables; in production, store them in Amazon Secrets Manager. API_USER = os.environ['SENDCLOUD_API_USER'] API_KEY = os.environ['SENDCLOUD_API_KEY'] SENDER_EMAIL = os.environ['SENDER_EMAIL'] # e.g., notifications@yourdomain.com ADDRESS_LIST = os.environ['ADDRESS_LIST'] # e.g., mylist@maillist.sendcloud.org # SendCloud API endpoint SENDCLOUD_API_URL = 'https://api.sendcloud.net/apiv2/mail/send' def lambda_handler(event, context): """ Receives an SNS message and sends it as an email via SendCloud. """ for record in event['Records']: sns_message = record['Sns'] subject = sns_message.get('Subject', 'Notification') message_body = sns_message.get('Message', '') timestamp = sns_message.get('Timestamp', '') topic_arn = sns_message.get('TopicArn', '') # Build email content html_body = f""" <html> <body> <p>{message_body}</p> <hr> <p style="font-size: 12px; color: #666;"> Source: {topic_arn}<br> Time: {timestamp} </p> </body> </html> """ # Send via SendCloud API params = { 'apiUser': API_USER, 'apiKey': API_KEY, 'from': SENDER_EMAIL, 'to': ADDRESS_LIST, 'useAddressList': 'true', 'subject': subject, 'html': html_body, } data = urllib.parse.urlencode(params).encode('utf-8') req = urllib.request.Request(SENDCLOUD_API_URL, data=data, method='POST') try: with urllib.request.urlopen(req) as response: result = json.loads(response.read().decode('utf-8')) if result.get('result'): print(f"Email sent successfully: {result.get('message')}") else: print(f"SendCloud error: {result}") raise Exception(f"SendCloud API error: {result.get('message')}") except Exception as e: print(f"Failed to send email: {str(e)}") raise # Let Lambda retry or send to DLQ return {'statusCode': 200, 'body': 'Messages processed'}

Migration script (Python): Export Amazon SNS subscriptions to SendCloud

The following script exports email subscriptions from an Amazon SNS topic and imports them into a SendCloud address list. Configure your Amazon Region, Amazon SNS topic ARN, SendCloud credentials, and address list before running.

Note

This simplified example has the credentials inline in the script. In production, consider storing credentials in Amazon Secrets Manager.

import boto3 import urllib.request import urllib.parse import json # Configuration — update these values before running REGION = 'cn-north-1' # or 'cn-northwest-1' for Ningxia TOPIC_ARN = 'arn:aws-cn:sns:cn-north-1:<YOUR_ACCOUNT_ID>:<YOUR_TOPIC_NAME>' # SendCloud credentials. This is a simplified example; in production, store # them in Amazon Secrets Manager rather than inline in the script. API_USER = '<YOUR_SENDCLOUD_API_USER>' API_KEY = '<YOUR_SENDCLOUD_API_KEY>' # your SendCloud address list alias ADDRESS_LIST = '<YOUR_ADDRESS_LIST>@maillist.sendcloud.org' # Amazon SDK sns_client = boto3.client('sns', region_name=REGION) SENDCLOUD_ADD_MEMBER_URL = 'https://api.sendcloud.net/apiv2/addressmember/add' def get_email_subscriptions(topic_arn): """Retrieve all email subscriptions from an SNS topic.""" emails = [] paginator = sns_client.get_paginator('list_subscriptions_by_topic') for page in paginator.paginate(TopicArn=topic_arn): for sub in page['Subscriptions']: if sub['Protocol'] in ('email', 'email-json'): emails.append(sub['Endpoint']) return emails def add_to_sendcloud(emails, batch_size=1000): """Add email addresses to a SendCloud address list in batches.""" for i in range(0, len(emails), batch_size): batch = emails[i:i + batch_size] members = ';'.join(batch) params = { 'apiUser': API_USER, 'apiKey': API_KEY, 'address': ADDRESS_LIST, 'members': members, } data = urllib.parse.urlencode(params).encode('utf-8') req = urllib.request.Request(SENDCLOUD_ADD_MEMBER_URL, data=data, method='POST') with urllib.request.urlopen(req) as response: result = json.loads(response.read().decode('utf-8')) if result.get('result'): print(f"Added {len(batch)} members (batch {i // batch_size + 1})") else: print(f"Error adding batch: {result}") if __name__ == '__main__': print(f"Exporting email subscriptions from {TOPIC_ARN}...") emails = get_email_subscriptions(TOPIC_ARN) print(f"Found {len(emails)} email subscriptions") print(f"Importing into SendCloud address list: {ADDRESS_LIST}...") add_to_sendcloud(emails) print("Migration complete!")

Need help or have questions?

If you need assistance or have feedback, contact Amazon Support.