terraform-provider-tailscale
terraform-provider-tailscale copied to clipboard
resource_device_authorization: update delete
deletes the device on authorization resouce deletion
What this PR does / why we need it: Ability to delete device with provider
Which issue this PR fixes: fixes #68
Worth to mention: if multiple resources are created/destroyed in a single run, users may face an error that some resources failed to be destroyed (due to device being removed already).
data "tailscale_device" "device1" {
name = "device1"
wait_for = "60s"
}
resource "tailscale_device_authorization" "authorization" {
device_id = data.tailscale_device.device1.id
authorized = true
}
resource "tailscale_device_key" "key" {
device_id = data.tailscale_device.device1.id
key_expiry_disabled = true
}
resource "tailscale_device_subnet_routes" "routes" {
device_id = data.tailscale_device.device1.id
routes = local.routes
}
› terraform destroy -auto-approve
---snip---
Error: Failed to set device subnet routes
internal server error (500)
Error: failed to update device key
internal server error (500)
User will have to make sure that device deletion happens last.
if multiple resources are created/destroyed in a single run, users may face an error that some resources failed to be destroyed (due to device being removed already).
This is part of the reason I don't like us managing deletion without creation, the UX suffers in a non-obvious way.