Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Cloud Notification Service
    • Overview
    • Getting started with mobile push notifications
    • Getting started with in-browser push notifications
    • Getting started with SMS
    • Getting started with topics
    • All guides
      • Create topic
      • Creating a subscription to a topic
      • Sending a notification to a topic
      • Managing a topic
      • Managing a subscription
    • Configuring logging
    • Overview
    • Mobile push notifications
    • In-browser push notifications
    • SMS
    • Topics
    • Quotas and limits
    • All tools
    • AWS CLI
    • AWS SDK for C++
    • AWS SDK for Go
    • AWS SDK for Java
    • AWS SDK for JavaScript
    • AWS SDK for Kotlin
    • AWS SDK for .NET
    • AWS SDK for PHP
    • AWS SDK for Python (boto3)
  • Pricing policy
  • Monitoring metrics
  • Logs Cloud Logging
  • Release notes
  1. Step-by-step operations
  2. Topics
  3. Creating a subscription to a topic

Creating a subscription

Written by
Yandex Cloud
Updated at September 23, 2025
Management console
AWS CLI
AWS SDK for Python
  1. In the management console, select the folder containing the topic.
  2. In the list of services, select Cloud Notification Service.
  3. Select Topics on the left.
  1. Select a topic.

  2. Select Subscriptions on the left.

  3. Click Create subscription.

  4. Select a notification channel type:

    • Mobile push notifications.

      Enter the endpoint ARN in arn:aws:sns::<cloud_id>:endpoint/<platform>/<channel_name>/<endpoint_unique_id> format. You can copy the ARN on the endpoint’s settings page.

    • In-browser push notifications.

      Enter the endpoint ARN in arn:aws:sns::<cloud_id>:endpoint/<platform>/<channel_name>/<endpoint_unique_id> format.

    • SMS.

      Enter your phone number in E.164 format, e.g., +79991112233. You do not need to pre-add the phone number to the SMS notification channel, but you need to create the channel itself.

  5. Click Create subscription.

    Subscribe other endpoints to the topic in the same way.

  1. If you do not have the AWS CLI yet, install and configure it.

  2. Run this command:

    aws sns subscribe \
      --topic-arn <topic_ARN> \
      --protocol <channel_type> \
      --notification-endpoint <endpoint_ARN_or_phone_number>
    

    Where:

    • topic-arn: Topic ARN.
    • protocol: Type of notification channel, e.g., sms, application.
    • notification-endpoint: ARN of the endpoint subscribing to the topic, in arn:aws:sns::<cloud_id>:endpoint/<platform>/<channel_name>/<endpoint_unique_id> format. For SMS, enter a phone number in E.164 format, e.g., +79991112233.

    For more information about the aws sns subscribe command, see the AWS documentation.

  1. If you do not have the AWS SDK for Python (boto3) yet, install and configure it.

  2. Use the following code to subscribe an endpoint to notifications in a topic:

    try:
        response = client.subscribe(
            TopicArn = "<topic_ARN>",
            Protocol = "<channel_type>",
            Endpoint = "<endpoint_ARN_or_phone_number>"
        )
        print(f"Topic ARN: {response['TopicArn']}")
    except botocore.exceptions.ClientError as error:
        print(f"Error: {error}")
    

    Where:

    • TopicArn: Topic ARN.
    • Protocol: Notification channel type, e.g., sms or application.
    • Endpoint: ARN of the endpoint subscribing to the topic, in arn:aws:sns::<cloud_id>:endpoint/<platform>/<channel_name>/<endpoint_unique_id> format. For SMS, enter a phone number in E.164 format, e.g., +79991112233.

Was the article helpful?

Previous
Create topic
Next
Sending a notification to a topic
© 2025 Direct Cursus Technology L.L.C.