Managing broker passwords
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.
Note
The broker is at the Preview stage.
To start exchanging messages between broker clients, you need to authenticate. This section describes how to manage broker passwords for the relevant authentication method.
Note
When an X.509 certificate is used along with a password, the password takes priority.
Adding a password to a broker
You can add a password to an already created broker or set it when creating a broker using the --password parameter.
Note
You can also set a password from the input stream by using the --read-password flag instead of --password.
Adding a password to an existing broker
- In the management console
, select the folder where you want to add a password to an existing broker. - Navigate
to IoT Core. - In the left-hand panel, select
Brokers. - Select the broker from the list.
- Under Passwords, click Add password.
- In the Password field, enter a password you will use to access the broker.
To create a password, you can use this password generator .
Make sure to save the password for later. - Click Add.
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.
To add a password:
-
Get a list of brokers in the folder:
yc iot broker listResult:
+----------------------+-------------------+ | ID | NAME | +----------------------+-------------------+ | arenou2oj4********** | my-broker | +----------------------+-------------------+ -
Add a password to the broker:
yc iot broker password add --broker-name my-broker --password Passw0rdForBrokerResult:
broker_id: arenou2oj4********** id: areuu2hgsv6k******** created_at: "2019-12-16T15:32:46.655139Z"
To add a password to a broker, use the addPassword REST API method for the Broker resource or the BrokerService/AddPassword gRPC API call.
Setting a password for a broker when creating it
For information on how to set a password for a broker when creating it, see Creating a broker.
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 with a password:
yc iot broker create --name broker-with-pass --password Passw0rdForDevice
Result:
done (1s)
id: areg96c8lo**********
folder_id: b1g88tflru**********
created_at: "2019-12-16T15:34:25.563Z"
name: broker-with-pass
status: ACTIVE
log_group_id: ckghhil3b5**********
To set a password for a broker when creating it, use the create REST API method for the Broker resource or the BrokerService/Create gRPC API call.
Getting a list of broker passwords
- In the management console
, select the folder where you want to get a list of broker passwords. - Navigate
to IoT Core. - In the left-hand panel, select
Brokers. - Select the broker from the list.
- On the Overview tab, go to Passwords.
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.
To get a list of passwords:
-
Get a list of brokers in the folder:
yc iot broker listResult:
+----------------------+--------------------+ | ID | NAME | +----------------------+--------------------+ | areg96c8lo********** | broker-with-pass | | arenou2oj4********** | my-broker | +----------------------+--------------------+ -
Get a list of broker passwords:
yc iot broker password list --broker-name broker-with-passResult:
+----------------------+---------------------+ | ID | CREATED AT | +----------------------+---------------------+ | are0gffs95********** | 2019-12-16 15:34:25 | +----------------------+---------------------+
To get a list of broker passwords, use the listPasswords REST API method for the Broker resource or the BrokerService/ListPasswords gRPC API call.
Deleting a broker password
- In the management console
, select the folder where you want to delete a broker password. - Navigate
to IoT Core. - In the left-hand panel, select
Brokers. - Select the broker from the list.
- To the right of the password you want to delete, click
→ Delete. - In the window that opens, click Delete.
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.
To delete a password:
-
Get a list of broker passwords:
yc iot broker password list --broker-name broker-with-passResult:
+----------------------+---------------------+ | ID | CREATED AT | +----------------------+---------------------+ | are0gffs95********** | 2019-12-16 15:34:25 | +----------------------+---------------------+ -
Delete the password:
yc iot broker password delete --broker-name broker-with-pass --password-id are0gffs957e******** -
Make sure the password has been deleted:
yc iot broker password list --broker-name broker-with-passResult:
+----+------------+ | ID | CREATED AT | +----+------------+ +----+------------+
To delete a broker password, use the deletePassword REST API method for the Broker resource or the BrokerService/DeletePassword gRPC API call.