Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex IoT Core
    • All guides
    • Sending messages
    • Subscribing a device or registry to receive messages
    • Exporting messages to Data Streams
    • Viewing the connection log
      • Getting information about a broker
      • Creating a broker
      • Updating a broker
      • Deleting a broker
    • Viewing operations with the service's resources
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ
  1. Step-by-step guides
  2. Managing brokers
  3. Creating a broker

Creating a broker

Written by
Yandex Cloud
Improved by
Danila N.
Updated at May 13, 2025

Note

The broker is at the Preview stage.

Management console
CLI
Terraform
API
  1. In the management console, select the folder where you want to create a broker.

  2. Select IoT Core.

  3. In the left-hand panel, select Brokers.

  4. Click Create broker.

  5. Under General information, specify:

    • Broker Name, e.g., my-broker.

    • (Optional) Description: Additional information about the broker.

    • (Optional) Password if you are going to use it instead of a certificate to access the broker. To create a password, you can use this password generator.

      Note

      Make sure to save your password, as you will need it for authentication.

    • (Optional) To assign a label to the broker, fill in the Key and Value fields and click Add label.

  6. (Optional) Add a certificate:

    • To add a file:

      1. Choose the File method.
      2. Click Attach file.
      3. Select the file with the public key of the certificate and click Open.
      4. Click Add.
    • To add text:

      1. Choose the Text method.
      2. Paste the certificate's public key to the Content field.
      3. Click Add.
  7. Click Create.

If you do not have the Yandex Cloud (CLI) command line interface yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

  1. Create a broker:

    yc iot broker create --name <broker_name>
    

    The naming requirements are as follows:

    • It must be from 2 to 63 characters long.
    • It may contain lowercase Latin letters, numbers, and hyphens.
    • It must start with a letter and cannot end with a hyphen.

    Result:

    id: b91ki3851h**********
    folder_id: aoek49ghmk*********
    created_at: "2022-05-28T11:29:42.420Z"
    name: <broker_name>
    status: ACTIVE
    
  2. (Optional) Assign the broker a password for authentication with a username and password:

    yc iot broker password add --broker-name <broker_name>
    

    You will be prompted to enter a password. Password requirements:

    • The password must contain numbers, upper-case and lower-case letters, and special characters.
    • It must be at least 14 characters long.

    Result:

    broker_id: b91ki3851h**********
    id: aoek49ghmk*********
    created_at: "2022-05-28T11:32:42.420Z"
    
  3. (Optional) Add to the broker a certificate for authentication with certificates:

    yc iot broker certificate add \
       --broker-name <broker_name> \
       --certificate-file <certificate>
    

    Where:

    • --broker-name: Broker name.
    • --certificate-file: Path to the public key of the certificate, such as cert.pem.

    Result:

    broker_id: b91ki3851h**********
    fingerprint: 1f21cf6d0183d****
    certificate_data: |
       -----BEGIN CERTIFICATE-----
       MIIEpDCCAow...
       -----END CERTIFICATE-----
    created_at: "2023-07-11T16:20:53.466370019Z"
    

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the documentation on the Terraform website or mirror website.

If you do not have Terraform yet, install it and configure its Yandex Cloud provider.

Note

To add certificates to a broker, generate them in advance.

To create a broker:

  1. In the configuration file, describe the parameters of the resource to create:

    • yandex_iot_core_broker: Broker parameters:
      • name: Broker name.
      • description: Broker description.
      • labels: Broker labels in key:value format.
      • certificates: List of broker certificates for authentication with certificates.

    Here is an example of the resource structure in the configuration file:

    resource "yandex_iot_core_broker" "my_broker" {
      name        = "test-broker"
      description = "test broker for terraform provider documentation"
      labels = {
        test-label = "label-test"
      }
    
      certificates = [
        file("<path_to_first_certificate_file>"),
        file("<path_to_second_certificate_file>")
      ]
    }
    
    output "yandex_iot_core_broker_my_broker" {
      value = "${yandex_iot_core_broker.my_broker.id}"
    }
    

    For more information about the resources you can create with Terraform, see the relevant provider documentation.

  2. Make sure the configuration files are correct.

    1. In the command line, navigate to the directory where you created the configuration file.

    2. Run a check using this command:

      terraform plan
      

    If you described the configuration correctly, the terminal will display a list of the resources being created and their settings. If the configuration contains any errors, Terraform will point them out.

  3. Deploy the cloud resources.

    1. If the configuration does not contain any errors, run this command:

      terraform apply
      
    2. Confirm creating the resources.

      This will create all resources you need in the specified folder. You can check the new resources and their settings using the management console or this CLI command:

      yc iot broker list
      

To create a broker, use the create REST API method for the Broker resource or the BrokerService/Create gRPC API call.

Was the article helpful?

Previous
Getting information about a broker
Next
Updating a broker
© 2025 Direct Cursus Technology L.L.C.