Skip to content

tailscale_dns_configuration.dns_override nameserver order causes continuous Terraform drift #779

Description

@AlexVranas

Describe the bug:
The tailscale_dns_configuration resource causes continuous in-place updates during terraform plan when using the dns_override configuration. The backend API appears to return nameserver records in a non-deterministic (shuffled) order. Because the Terraform provider evaluates the returned order against the state file, it constantly flags these ordering changes as drift, causing noisy diffs even when the user hasn't touched the configuration.

To Reproduce:

  1. Configure a tailscale_dns_configuration resource containing a nameservers block with multiple addresses (e.g., 1.1.1.1, 1.0.0.3, 1.1.1.3).
  2. Run terraform apply to provision the initial configuration.
  3. Run terraform plan on subsequent pipeline runs or local executions.
  4. Observe the Terraform output showing pending in-place updates that simply swap the order of the exact same nameserver IP addresses.

Expected behavior:
The Terraform provider should ideally treat the nameservers block as an unordered set (TypeSet) rather than an ordered list (TypeList) to ignore array shuffling. Alternatively, the backend API should return the nameserver records in a deterministic, consistent order so that Terraform does not interpret the shuffle as configuration drift.

Additional context:
A customer reported this issue via a support ticket. They provided the following snippet from their GitHub Actions log, illustrating the constant swapping behavior:

Warning: Alpha Resource with tailscale_dns_configuration.dns_override,
The tailscale_dns_configuration resource is currently in alpha and subject to change, proceed with caution.

  ~ nameservers {
      ~ address = "1.1.1.1" -> "1.1.1.3"
    }
  ~ nameservers {
      ~ address = "1.1.1.3" -> "1.0.0.3"
    }
  ~ nameservers {
      ~ address = "1.0.0.3" -> "1.1.1.1"
    }

See also go/tss/89939

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions