Getting started with Yandex IoT Core device registries
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, create the following:
Next, set up message exchange between the device and the registry.
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 certificate
X.509 certificates are required for communication between the MQTT clients, i.e., the registry and the device. Each client requires its own certificate.
-
If you already have certificates, add them to the MQTT clients. You can do this when creating clients.
-
If you do not have certificates, create them using OpenSSL
(the command below creates only one certificate):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.
Use different file names for the private and public key files of each MQTT client.
Create a registry
-
In the management console
, select the folder where you want to create your registry. -
Navigate
to IoT Core. -
In the left-hand panel, select
Registries. -
Click Create registry.
-
Under General information, specify
my-registryas the registry name. -
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 registry:
yc iot registry create --name my-registryResult:
id: b91hafek85********** folder_id: aoek49ghmk********* created_at: "2019-05-27T13:40:06.923Z" name: my-registry status: ACTIVE log_group_id: ckghotead********** -
Add a certificate to the registry:
yc iot registry certificate add \ --registry-name my-registry \ --certificate-file registry-cert.pemWhere:
--registry-name: Registry name.--certificate-file: Path to the certificate’s public key.
Result:
registry_id: b91hafek85********** fingerprint: 589ce16050**** certificate_data: | -----BEGIN CERTIFICATE----- MIIE/jCCAuagAwIBAgIJAPRA... -----END CERTIFICATE----- created_at: "2019-05-27T13:41:45.295Z"
Create a device
-
In the management console
, select the folder where you want to create your device. -
Navigate
to IoT Core. -
In the left-hand panel, select
Registries and openmy-registry. -
Navigate to the Devices tab.
-
Click Add device.
-
Under General information, specify
my-deviceas the device name. -
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.
-
Create a device:
yc iot device create \ --registry-name my-registry \ --name my-deviceWhere:
--registry-name: Name of the registry the device belongs to.--name: Device name.
Result:
id: b912an77oq********** registry_id: b91hafek85********** created_at: "2019-05-27T13:44:35.164Z" name: my-device -
Add a certificate to the device:
yc iot device certificate add \ --device-name my-device \ --certificate-file ./certs/device-cert.pemWhere:
--device-name: Device name.--certificate-file: Path to the certificate’s public key.
Result:
device_id: b912an77oq********** fingerprint: 65e5b05006*** certificate_data: | -----BEGIN CERTIFICATE----- MIIE/jCCAuagAwIBAgIJANZbq... -----END CERTIFICATE----- created_at: "2019-05-27T13:45:23.306Z"
Set up message exchange between the device and the registry
What's next
- Read about service concepts.
- Find out how to work with registries and devices.