tailscale-policy: data source lookup wants hostname, not name #137

Closed
opened 2026-05-26 17:57:29 +00:00 by coilysiren · 0 comments
Owner

Problem

First run of terraform-tailscale-policy action=import-acl failed at the data-source phase:

Error: Failed to fetch devices
  with data.tailscale_device.physical["kai-desktop-tower"]
  could not find device withname="kai-desktop-tower"

The tailscale_device data source's name argument matches the device's full MagicDNS FQDN (e.g. kai-desktop-tower.tailXXXX.ts.net), not the short hostname. The short name belongs on the hostname argument instead.

Change

terraform/tailscale-policy/main.tf - switch the data "tailscale_device" "physical" lookup from name = each.key to hostname = each.key. Comment updated to explain the FQDN vs hostname split.

Also commits the auto-generated terraform/tailscale-policy/.terraform.lock.hcl (provider pin) that terraform init produced, matching the sibling tailscale modules.

Filed by Claude.

**Problem** First run of `terraform-tailscale-policy action=import-acl` failed at the data-source phase: ``` Error: Failed to fetch devices with data.tailscale_device.physical["kai-desktop-tower"] could not find device withname="kai-desktop-tower" ``` The `tailscale_device` data source's `name` argument matches the device's full MagicDNS FQDN (e.g. `kai-desktop-tower.tailXXXX.ts.net`), not the short hostname. The short name belongs on the `hostname` argument instead. **Change** `terraform/tailscale-policy/main.tf` - switch the `data "tailscale_device" "physical"` lookup from `name = each.key` to `hostname = each.key`. Comment updated to explain the FQDN vs hostname split. Also commits the auto-generated `terraform/tailscale-policy/.terraform.lock.hcl` (provider pin) that `terraform init` produced, matching the sibling tailscale modules. Filed by Claude.
Sign in to join this conversation.
No description provided.