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
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
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 devices
      • Creating a device
      • Updating a device
      • Deleting a device
    • 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 devices
  3. Creating a device

Creating a device

Written by
Yandex Cloud
Improved by
Danila N.
Updated at May 13, 2025
Management console
CLI
Terraform
API
  1. In the management console, select a folder to create a device in.

  2. Select IoT Core.

  3. Select the required registry from the list.

  4. On the left side of the window, select the Devices section.

  5. Click Add device.

  6. Under General information, add:

    • Device Name, e.g., my-device.

    • (Optional) Description with additional information about the device.

    • (Optional) Password that you will use to access the device. To create a password, you can use the password generator.

      Note

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

  7. (Optional) Add aliases:

    1. Click Add alias.
    2. Fill in the fields: enter an alias, e.g., events, and the topic type after $devices/<device_ID>, e.g., events. You will be able to use the events alias instead of the $devices/<device_ID>/events topic.
  8. (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.
  9. Click Create.

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

  1. Review a list of the registries where you can create a device or create a new registry.

  2. Create a device:

    yc iot device create \
       --registry-name <registry_name> \
       --name <device_name>
    

    The device 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: b9135goeh**********
    registry_id: b91ki3851h**********
    created_at: "2019-05-28T16:08:30.938Z"
    name: <device_name>
    status: ACTIVE
    
  3. (Optional) Assign the device a password for authentication with a username and password:

    yc iot device password add --device-name <device_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:

    device_id: b9135goeh**********
    id: aoek49ghmk*********
    created_at: "2019-05-28T16:12:30.938Z"
    
  4. (Optional) Add to the registry a certificate for authentication with certificates:

    yc iot device certificate add \
       --device-name <device_name> \
       --certificate-file <certificate>
    

    Where:

    • --device-name: Device name.
    • --certificate-file: Path to the public key of the certificate, e.g., cert.pem.

    Result:

    device_id: b9135goeh**********
    fingerprint: 589ce16050****
    certificate_data: |
       -----BEGIN CERTIFICATE-----
       MIIE/jCCAuagAwIBAgIJAPRA...
       -----END CERTIFICATE-----
    created_at: "2019-05-28T16:15:30.938Z"
    
  5. (Optional) Add aliases:

    yc iot device add-topic-aliases \
       --name <device_name> \
       --topic-aliases <alias>='<topic>'
    

    Example:

    yc iot device add-topic-aliases \
       --name my-device \
       --topic-aliases events='$devices/are0ej5kpik1********/events'
    

    Result:

    id: aoek49ghmk*********
    registry_id: b91ki3851h**********
    created_at: "2019-05-28T16:17:30.938Z"
    name: <device_name>
    topic_aliases:
      <alias>: <topic>
    status: ACTIVE
    

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 device, generate them in advance.

To create a device:

  1. Review a list of the registries where you can create a device or create a new registry.

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

    • yandex_iot_core_registry: Device properties:

      • registry_id: ID of the registry where the device will be created.
      • name: Device name.
      • description: Device description.
      • aliases: Topic aliases. For more detail, please see Creating an alias.
      • passwords: List of passwords for authentication with a username and password.
      • certificates: List of certificates for authentication with certificates.

    Note

    Make sure to use only one of the two authentication methods.

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

    resource "yandex_iot_core_device" "my_device" {
      registry_id = "<registry_ID>"
      name        = "test-device"
      description = "test device for terraform provider documentation"
      
      aliases = {
        "some-alias1/subtopic" = "$devices/{id}/events/somesubtopic",
        "some-alias2/subtopic" = "$devices/{id}/events/aaa/bbb",
      }
      
      passwords = [
        "<password>",
      ]
      
      certificates = [
        file("<certificate_file_path>")
      ]
    }
    

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

  3. Make sure the configuration files are correct.

    1. In the command line, go to the folder where you created the configuration file.
    2. Run a check using this command:
      terraform plan
      

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

  4. Deploy cloud resources.

    1. If the configuration does not contain any errors, run this command:
      terraform apply
      
    2. Confirm that you want to create the resources.

    All the resources you need will then be created in the specified folder. You can check the new resources and their settings using the management console.

To create a device, use the create REST API method for the Device resource or the DeviceService/Create gRPC API call.

Was the article helpful?

Previous
Getting information about devices
Next
Updating a device
Yandex project
© 2025 Yandex.Cloud LLC