Yandex Cloud
Documentation
PresentationContact UsTry it for free
© 2026 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
      • Creating a 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
  • Access management
  • Audit Trails events
  • Metrics Monitoring
  • Logs Cloud Logging
  • Release notes
  1. Step-by-step guides
  2. Topics
  3. Creating a subscription to a topic

Creating a subscription

Written by
Yandex Cloud
Updated at November 5, 2026
View in Markdown
Management console
AWS CLI
AWS SDK for Python
  1. In the management console, select the folder containing the topic.

  2. Navigate to 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.

      • Yandex Message Queue

        Enter the Message Queue URL.

    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: Notification channel type, e.g., sms, application, sqs.

    • notification-endpoint: Endpoint subscribing to the topic.

      • For both mobile and browser push notifications, enter your endpoint ARN 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 Message Queue, enter the queue URL.

      For a topic to be able to send messages to a queue, it must have the SQSServiceAccountId attribute set. See the guide on creating and managing a topic for more details.

    Learn more about the aws sns subscribe command in this AWS guide.

  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_or_queue_URL>"
        )
        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, application, or sqs.

    • Endpoint: Endpoint subscribing to the topic:

      • For both mobile and browser push notifications, enter your endpoint ARN 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 Message Queue, enter the queue URL.

      For a topic to be able to send messages to a queue, it must have the SQSServiceAccountId attribute set. For details, see the guides on creating and managing a topic.

Was the article helpful?

Previous
Creating a topic
Next
Sending a notification to a topic
© 2026 Direct Cursus Technology L.L.C.