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 topic

Creating a topic

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.

  2. Navigate to Cloud Notification Service.

  3. Select Topics on the left.

  4. Click Create topic.

  5. Enter a name for the topic. The name must be unique within Cloud Notification Service.

  6. Optionally, set up logging:

    1. Under Logging, enable the Write logs option.
    2. In the Folder list, select a folder to house the log group.
    3. In the Log group field, select an existing log group or create a new one.
  7. Optionally, enable Yandex Message Queue to send messages to Message Queue queues subscribed to the topic. Specify a service account assigned the ymq.writer role:

    • For the folder with the queues subscribed to the topic.
    • For the folder with the service account itself.

    How to assign a role.

  8. Click Create topic.

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

  2. Run this command:

    aws sns create-topic \
      --name <topic_name> \
      --attributes "{\"SQSServiceAccountId\":\"<service_account_ID>\"}"
    

    Where:

    • name: Topic name, which can be any name unique within Cloud Notification Service.
    • SQSServiceAccountId: ID of the service account you are going to use to send messages from the topic to a Message Queue. This is an optional parameter. The service account must have the ymq.writer role:

      • For the folder with the queues subscribed to the topic.
      • For the folder with the service account itself.

      Note

      To specify a service account in the SQSServiceAccountId attribute, the user must have the iam.serviceAccounts.user role for the folder with the service account. Otherwise, the command will fail with an authorization error.

    Learn more about the aws sns create-topic 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 create a topic:

    response = client.create_topic(
        Name="<topic_name>",
        Attributes={
            "SQSServiceAccountId": "<service_account_ID>",
        },
    )
    
    print(f"Topic ARN:", response['TopicArn'])
    

    Where:

    • Name: Topic name, which can be any name unique within Cloud Notification Service.
    • SQSServiceAccountId: ID of the service account you are going to use to send messages from the topic to a Message Queue. This is an optional parameter. The service account must have the ymq.writer role:

      • For the folder with the queues subscribed to the topic.
      • For the folder with the service account itself.

      Note

      To specify a service account in the SQSServiceAccountId attribute, the user must have the iam.serviceAccounts.user role for the folder with the service account. Otherwise, the command will fail with an authorization error.

Once you create a topic, you cannot change its name. To add endpoints to a topic, create subscriptions.

Was the article helpful?

Previous
Exiting the sandbox
Next
Creating a subscription to a topic
© 2026 Direct Cursus Technology L.L.C.