Creating a registry
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.
-
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 the following:
-
Registry Name, e.g.,
my-registry. -
Optionally, Description with additional information about the registry.
-
Password to use when accessing the registry. To create a password, you can use this password generator
.Note
Save the password, as you will need it for authentication.
-
Optionally, to assign a label to the registry, fill out the Key and Value fields and click Add label.
-
-
Optionally, add a certificate:
-
To add a file:
- Select the
Filemethod. - Click Attach file.
- Select the file with the certificate’s public key and click Open.
- Click Add.
- Select the
-
To add text:
- Select the
Textmethod. - Paste the certificate’s public key into the Content field.
- Click Add.
- Select the
-
-
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 <registry_name>The registry naming requirements are as follows:
- Length: between 3 and 63 characters.
- It can only contain lowercase Latin letters, numbers, and hyphens.
- It must start with a letter and cannot end with a hyphen.
Result:
id: b91hafek85********** folder_id: aoek49ghmk********* created_at: "2019-05-27T13:40:06.923Z" name: <registry_name> status: ACTIVE log_group_id: ckghotead********** -
Optionally, set a password for the registry for username and password authentication:
yc iot registry password add --registry-name <registry_name>You will be prompted to enter a password. Follow these password requirements:
- The password must contain numbers, uppercase and lowercase letters, and special characters.
- The password must be at least 14 characters long.
Result:
registry_id: b91hafek85********** id: aoek49ghmk********* created_at: "2019-05-27T13:44:06.923Z" -
Optionally, add a certificate to the registry for certificate-based authentication:
yc iot registry certificate add \ --registry-name <registry_name> \ --certificate-file <certificate>Where:
--registry-name: Registry name.--certificate-file: Path to the public key of the certificate, e.g.,cert.pem.
Result:
registry_id: b91hafek85********** fingerprint: 589ce16050**** certificate_data: | -----BEGIN CERTIFICATE----- MIIE/jCCAuagAwIBAgIJAPRA... -----END CERTIFICATE----- created_at: "2019-05-27T13:41:45.295Z"
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the guides on the Terraform
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), authenticate using the appropriate method.
Note
To add certificates to a registry, create them in advance.
To create a device registry:
-
In the configuration file, describe the resource you want to create:
-
yandex_iot_core_registry: Registry settings:name: Registry name.description: Registry description.labels: Registry labels inkey:valueformat.passwords: List of registry passwords for username and password authentication.certificates: List of registry certificates for certificate-based authentication.
Note
Use only one of the two authentication methods.
Here is an example of a resource structure in the configuration file:
resource "yandex_iot_core_registry" "my_registry" { name = "test-registry" description = "test registry for terraform provider documentation" labels = { test-label = "label-test" } passwords = [ "<password_1>", "<password_2>" ] certificates = [ file("<path_to_first_certificate_file>"), file("<path_to_second_certificate_file>") ] } output "yandex_iot_core_registry_my_registry" { value = "${yandex_iot_core_registry.my_registry.id}" }For more information about the resources you can create with Terraform, see this provider guide.
-
-
Make sure the configuration files are correct.
-
In the terminal, navigate to the directory where you created your configuration file.
-
Run a check using this command:
terraform plan
If the configuration is correct, the terminal will display a list of the resources and their settings. Terraform will show any errors detected in the configuration.
-
-
Deploy the cloud resources.
-
If the configuration is correct, run this command:
terraform apply -
Confirm creating the resources.
This will create all the 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 registry list
-
To create a registry, use the create REST API method for the Registry resource or the RegistryService/Create gRPC API call.