Deleting a device
To access a device, use its unique ID or name. For information about how to get its unique ID or name, see Getting information about devices
To delete a device:
- In the management console
, select the folder to delete the device from. - Select IoT Core.
- Select the required registry from the list.
- On the left side of the window, select the Devices section.
- To the right of the name of the device to delete, click
and select Delete from the drop-down list. - In the window that opens, click Delete.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
-
Delete the device:
yc iot device delete my-device
-
Make sure the device was deleted:
yc iot device list --registry-name my-registry
Result:
+----+------+ | ID | NAME | +----+------+ +----+------+
Terraform
For more information about the provider resources, see the documentation on the Terraform
If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.
If you don't have Terraform, install it and configure the Yandex Cloud provider.
To delete a device created using Terraform:
-
Open the Terraform configuration file and delete the fragment with the device description.
Example device description in the Terraform configuration:
resource "yandex_iot_core_device" "my_device" { registry_id = "<registry_ID>" name = "test-device" description = "test device for terraform provider documentation" ... }
For more information about the
yandex_iot_core_device
resource parameters in Terraform, see the relevant provider documentation . -
In the command line, change to the folder where you edited the configuration file.
-
Make sure the configuration file is correct using this command:
terraform validate
If the configuration is correct, you will get this message:
Success! The configuration is valid.
-
Run this command:
terraform plan
The terminal will display a list of resources with parameters. No changes will be made at this step. If the configuration contains any errors, Terraform will point them out.
-
Apply the configuration changes:
terraform apply
-
Confirm the changes: type
yes
into the terminal and press Enter.You can check the update using the management console
or this CLI command:yc iot device list --registry-id <registry_ID>
To delete a device, use the delete REST API method for the Device resource or the DeviceService/Delete gRPC API call.