Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Blog
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
Yandex project
© 2023 Yandex.Cloud LLC
Yandex IoT Core
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Sending messages
    • Subscribing a device or registry to receive messages
    • Viewing the connection log
    • Creating a trigger for a topic
    • Managing registries
      • Getting information about registries
      • Creating a registry
      • Updating a registry
      • Deleting a registry
    • Managing devices
      • Managing topic aliases
        • Creating an alias
        • Getting a list of aliases
        • Updating an alias
        • Deleting an alias
      • Getting information about devices
      • Creating a device
      • Updating a device
      • Deleting a device
    • Managing brokers
      • Getting information about a broker
      • Creating a broker
      • Updating a broker
      • Deleting a broker
    • Managing certificates
      • Create a certificate
      • Managing registry certificates
      • Managing device certificates
      • Managing broker certificates
    • Managing passwords
      • Managing registry passwords
      • Managing device passwords
      • Managing broker passwords
  • Concepts
    • Authorization
    • Relationship between service resources
    • MQTT server connection parameters
    • Sending messages to an MQTT server via gRPC
    • Topic
      • Overview
      • Device topics
      • Registry topics
      • Subtopic
      • Using topics
    • Backups
    • Quotas and limits
  • Practical guidelines
    • All tutorials
    • Working with Mosquitto
      • Sending messages
      • Subscribing a device or registry to receive messages
    • Working with Yandex IoT Core from an Android device in Java
    • Working with Yandex IoT Core in C#
    • Working with Yandex IoT Core in Java
    • Writing data from a device to Managed Service for PostgreSQL
  • Access management
  • Pricing policy
  • Devices API reference
    • Authentication in the API
    • gRPC
      • Overview
      • DeviceDataService
      • DeviceService
      • RegistryDataService
      • RegistryService
      • OperationService
    • REST
      • Overview
      • DeviceData
        • Overview
        • publish
      • Device
        • Overview
        • addCertificate
        • addPassword
        • create
        • delete
        • deleteCertificate
        • deletePassword
        • get
        • getByName
        • list
        • listCertificates
        • listOperations
        • listPasswords
        • update
      • RegistryData
        • Overview
        • publish
      • Registry
        • Overview
        • addCertificate
        • addPassword
        • create
        • delete
        • deleteCertificate
        • deletePassword
        • get
        • getByName
        • list
        • listCertificates
        • listDeviceTopicAliases
        • listOperations
        • listPasswords
        • update
  • Broker API reference
    • Authentication in the API
    • gRPC
      • Overview
      • BrokerDataService
      • BrokerService
      • OperationService
    • REST
      • Overview
      • BrokerData
        • Overview
        • publish
      • Broker
        • Overview
        • addCertificate
        • addPassword
        • create
        • delete
        • deleteCertificate
        • deletePassword
        • get
        • list
        • listCertificates
        • listOperations
        • listPasswords
        • update
  • Questions and answers
  1. Step-by-step instructions
  2. Managing passwords
  3. Managing registry passwords

Managing registry passwords

Written by
Yandex Cloud
  • Adding a password to a registry
    • Adding a password to an existing registry
    • Setting a password for a registry when creating it
  • Getting a list of registry passwords
  • Deleting a registry password

For devices and registries to begin exchanging data and commands, you need to log in. This section describes how to manage registry passwords for the appropriate authorization method.

Note

When using an X.509 certificate along with a password, the password has higher priority.

  • Adding a password
  • Viewing a password list
  • Deleting a password

Adding a password to a registry

You can add a password to an existing registry or set it when creating a registry using the --password parameter.

Note

You can also set a password from the input stream. To do this, use the --read-password flag instead of the --password parameter.

Adding a password to an existing registry

Management console
CLI
Terraform
API

To add a password to an existing registry:

  1. In the management console, select the folder where you wish to set a password for a previously created registry.
  2. Select Yandex IoT Core.
  3. Select the desired registry from the list.
  4. Under Passwords, click Add password.
  5. In the Password field, enter the password you will be using to access your registry.
    You can use a password generator to create a password.
    Make sure you save the password - you will need it later.
  6. Click Add.

If you don't have the Yandex Cloud command line interface yet, install and initialize it.

To add a password:

  1. Get a list of registries in the folder:

    yc iot registry list
    

    Result:

    +----------------------+-------------------+
    |          ID          |       NAME        |
    +----------------------+-------------------+
    | arenou2oj4ct42eq82er | my-registry       |
    +----------------------+-------------------+
    
  2. Add a password to the registry:

    yc iot registry password add --registry-name my-registry --password Passw0rdForRegistry
    

    Result:

    registry_id: arenou2oj4ct42eq8g3n
    id: areuu2hgsv6klgbd4e6d
    created_at: "2019-12-16T15:32:46.655139Z"
    

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it by configuration files. They store the infrastructure description in HashiCorp Configuration Language (HCL). Terraform and its providers are distributed under the Mozilla Public License.

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

If you change the configuration files, Terraform automatically determines which part of your configuration is already deployed and what should be added or removed.

For more information about Terraform, see the documentation.

To add a password to a registry created using Terraform:

  1. In the configuration file, describe the parameters of resources that you want to create:

    • yandex_iot_core_registry: Registry parameters:
      • name: Registry name.
      • description: Registry description.
      • passwords: List of registry passwords for authorization using a username and password.

    Sample resource structure in the configuration file:

    resource "yandex_iot_core_registry" "my_registry" {
      name        = "test-registry"
      description = "test registry for terraform provider documentation"
    ...
      passwords = [
        "<password_1>",
        "<password_2>"
      ]
    ...
    }
    

    For more information about the yandex_iot_core_registry resource parameters in Terraform, see the provider documentation.

  2. In the command line, change to the folder where you edited the configuration file.

  3. Make sure the configuration file is correct using the command:

    terraform validate
    

    If the configuration is correct, the following message is returned:

    Success! The configuration is valid.
    
  4. Run the command:

    terraform plan
    

    The terminal will display a list of resources with parameters. No changes are made at this step. If there are errors in the configuration, Terraform points them out.

  5. Apply the configuration changes:

    terraform apply
    
  6. Confirm the changes: type yes in the terminal and press Enter.

    You can verify registry passwords in the management console or using the following CLI command:

    yc iot registry password list --registry-name <registry_name>
    

You can add a registry password using the API addPassword method.

Setting a password for a registry when creating it

Management console
CLI
Terraform
API

To lean about setting a password for a registry being created, please see Creating a registry.

If you don't have the Yandex Cloud command line interface yet, install and initialize it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

Create a registry with a password:

yc iot registry create --name registry-with-pass --password Passw0rdForDevice

Result:

done (1s)
id: areg96c8loruvvudj54t
folder_id: b1g88tflru0ek1omtfd3
created_at: "2019-12-16T15:34:25.563Z"
name: registry-with-pass
status: ACTIVE
log_group_id: ckghhil3b5o9t4pf1nvg

To lean about setting a password for a registry being created, please see Creating a registry.

You can set a registry password when creating it using the API create method.

Getting a list of registry passwords

Management console
CLI
API

To view the list of registry passwords:

  1. In the management console, select the folder to get the list of registry passwords for.
  2. Select Yandex IoT Core.
  3. Select the desired registry from the list.
  4. On the Overview page, go to the Passwords section.

If you don't have the Yandex Cloud command line interface yet, install and initialize it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

To get a list of passwords:

  1. Get a list of registries in the folder:

    yc iot registry list
    

    Result:

    +----------------------+--------------------+
    |          ID          |        NAME        |
    +----------------------+--------------------+
    | areg96c8loruvvudj54t | registry-with-pass |
    | arenou2oj4ct42eq82er | my-registry        |
    +----------------------+--------------------+
    
  2. Get a list of registry passwords:

    yc iot registry password list --registry-name registry-with-pass
    

    Result:

    +----------------------+---------------------+
    |          ID          |     CREATED AT      |
    +----------------------+---------------------+
    | are0gffs957egmoksgf4 | 2019-12-16 15:34:25 |
    +----------------------+---------------------+
    

You can get a list of registry passwords using the API listPasswords method.

Deleting a registry password

Management console
CLI
Terraform
API

To delete a registry password:

  1. In the management console, select the folder to delete the registry password from.
  2. Select Yandex IoT Core.
  3. Select the desired registry from the list.
  4. In the row with the password you need, click and select Delete from the drop-down list.
  5. In the window that opens, click Delete.

If you don't have the Yandex Cloud command line interface yet, install and initialize it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

To delete a password:

  1. Get a list of registry passwords:

    yc iot registry password list --registry-name registry-with-pass
    

    Result:

    +----------------------+---------------------+
    |          ID          |     CREATED AT      |
    +----------------------+---------------------+
    | are0gffs957egmoksgf4 | 2019-12-16 15:34:25 |
    +----------------------+---------------------+
    
  2. Delete the password:

    yc iot registry password delete --registry-name registry-with-pass --password-id are0gffs957egmoksgf4
    
  3. Make sure that the password was deleted:

    yc iot registry password list --registry-name registry-with-pass
    

    Result:

    +----+------------+
    | ID | CREATED AT |
    +----+------------+
    +----+------------+
    

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it by configuration files. They store the infrastructure description in HashiCorp Configuration Language (HCL). Terraform and its providers are distributed under the Mozilla Public License.

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

If you change the configuration files, Terraform automatically determines which part of your configuration is already deployed and what should be added or removed.

For more information about Terraform, see the documentation.

To delete the password of a registry created using Terraform:

  1. Open the Terraform configuration file and delete the value of the password in the passwords block, in the fragment with the registry description. To delete all passwords, delete the entire passwords block.

    Example registry description in the Terraform configuration:

    resource "yandex_iot_core_registry" "my_registry" {
      name        = "test-registry"
      description = "test registry for terraform provider documentation"
    ...
      passwords = [
        "<password_1>",
        "<password_2>"
      ]
    ...
    }
    

    For more information about the yandex_iot_core_registry resource parameters in Terraform, see the provider documentation.

  2. In the command line, change to the folder where you edited the configuration file.

  3. Make sure the configuration file is correct using the command:

    terraform validate
    

    If the configuration is correct, the following message is returned:

    Success! The configuration is valid.
    
  4. Run the command:

    terraform plan
    

    The terminal will display a list of resources with parameters. No changes are made at this step. If there are errors in the configuration, Terraform points them out.

  5. Apply the configuration changes:

    terraform apply
    
  6. Confirm the changes: type yes in the terminal and press Enter.

    You can verify registry passwords in the management console or using the following CLI command:

    yc iot registry password list --registry-name <registry_name>
    

You can delete a registry password using the API deletePassword method.

Was the article helpful?

Language / Region
Yandex project
© 2023 Yandex.Cloud LLC
In this article:
  • Adding a password to a registry
  • Adding a password to an existing registry
  • Setting a password for a registry when creating it
  • Getting a list of registry passwords
  • Deleting a registry password