Deleting an alias
Aliases are linked to specific devices. To delete an alias, you need to find the device ID or name.
To delete an alias:
- In the management console, select the folder to delete the alias from.
- Select Yandex IoT Core.
- Select the desired registry from the list.
- In the left part of the window, select Devices.
- To the right of the name of the device you need, click
- To the right of the alias to delete, click
. - Click Save.
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.
Delete an alias:
yc iot device remove-topic-aliases arenak5ciqss6pbas6js --topic-aliases commands
Result:
id: arenak5ciqss6pbas6js
registry_id: arenou2oj4ct42eq8g3n
created_at: "2019-09-16T12:32:48.911Z"
name: second
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 an alias created with Terraform:
-
Open the Terraform configuration file and delete the value of the alias in the
aliases
block, in the fragment with the device description. To remove all aliases, delete the entirealiases
block.Example device description in the Terraform configuration:
resource "yandex_iot_core_device" "my_device" { registry_id = "<registry_ID>" name = "<device_name>" description = "test device for terraform provider documentation" aliases = { "some-alias1/subtopic" = "$devices/{id}/events/somesubtopic", "some-alias2/subtopic" = "$devices/{id}/events/aaa/bbb", } ... }
For more information about the
yandex_iot_core_device
resource parameters in Terraform, see the provider documentation. -
In the command line, change to the folder where you edited the configuration file.
-
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.
-
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.
-
Apply the configuration changes:
terraform apply
-
Confirm the changes: type
yes
in the terminal and press Enter.You can verify device aliases in the management console or using the following CLI command:
yc iot device get <device_name>