Getting started with Yandex IoT Core brokers
Warning
Yandex IoT Core is no longer available to new users.
Current users can create resources until November 1, 2026. Afterwards, the service will go read-only and cease to operate on December 1, 2026. For more information on the timing and procedure, see Service shutdown.
To get started with Yandex IoT Core:
Note
The broker is at the Preview stage.
Getting started
Sign up for Yandex Cloud and create a billing account:
- Navigate to the management console
and log in to Yandex Cloud or create a new account. - On the Yandex Cloud Billing
page, make sure you have a billing account linked and it has theACTIVEorTRIAL_ACTIVEstatus. If you do not have a billing account, create one and link a cloud to it.
If you have an active billing account, you can create or select a folder for your infrastructure on the cloud page
Learn more about clouds and folders here.
Create a broker certificate
If you already have a certificate, add it to the broker after creating it. If you do not have a certificate, create one using OpenSSL
openssl req -x509 \
-newkey rsa:4096 \
-keyout private-key.pem \
-out cert.pem \
-nodes \
-days 365 \
-subj '/CN=localhost'
Where:
-x509: Certificate type, X.509.-newkey: Encryption algorithm.-keyout: File with the certificate's private key.-out: File with the certificate's public key.-nodes: Flag to use when you do not need to encrypt the public key.-days: Certificate validity period, in days.-subj: Request subject.
Create a broker
-
In the management console
, select the folder where you want to create your broker. -
Navigate
to IoT Core. -
In the left-hand panel, select
Brokers. -
Click Create broker.
-
Under General information, specify
my-brokeras the Name broker. -
Add a certificate:
-
To add a file:
- Click Add certificate.
- Select the
Filemethod. - Click Attach file.
- Select the certificate’s public key file and click Open.
- Click Add.
-
To add text:
- Click Add certificate.
- Select the
Textmethod. - Paste the certificate’s public key into the Content field.
- Click Add.
-
-
Click Create.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id.
If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
-
Create a broker:
yc iot broker create --name my-brokerResult:
id: b91ki3851h********** folder_id: aoek49ghmk********* created_at: "2022-05-28T11:29:42.420Z" name: my-broker status: ACTIVE -
Add the certificate to the broker:
yc iot broker certificate add \ --broker-name my-broker \ --certificate-file cert.pemWhere:
--broker-name: Broker name.--certificate-file: Path to the certificate's public key.
Result:
broker_id: b91ki3851h********** fingerprint: 1f21cf6d0183d**** certificate_data: | -----BEGIN CERTIFICATE----- MIIEpDCCAow... -----END CERTIFICATE----- created_at: "2023-07-11T16:20:53.466370019Z"
Set up message exchange
What's next
- Read about service concepts.
- Learn how to work with brokers.