Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix imports for splitdns #363

Merged
merged 1 commit into from
May 3, 2024
Merged

Conversation

keeleysam
Copy link
Contributor

@keeleysam keeleysam commented May 3, 2024

What this PR does / why we need it:
Currently if you use import on tailscale_dns_split_nameservers, the domain attribute will get set to null in the terraform state, and thus will result in

Since the resource ID and domain are the same, set domain to the resource ID.
sample code:

import {
  to = tailscale_dns_split_nameservers.example-com
  id = "example.com"
}

resource "tailscale_dns_split_nameservers" "example-com" {
  domain      = "example.com"
  nameservers = [
        "1.2.3.4",
        "5.6.7.8"
  ]
}

Before:

# tailscale_dns_split_nameservers.example-com will be updated in-place
~ resource "tailscale_dns_split_nameservers" "example-com" {
    + domain      = "example.com"
      id          = "example.com"
      nameservers = [
        "1.2.3.4",
        "5.6.7.8"
      ]
  }

after:

  # tailscale_dns_split_nameservers.example-com will be imported
resource "tailscale_dns_split_nameservers" "example-com" {
    domain      = "example.com"
    id          = "example.com"
    nameservers = [
        "1.2.3.4",
        "5.6.7.8"
      ]
}

Which issue this PR fixes (use fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged):

see above

Special notes for your reviewer:

Copy link
Contributor

@mpminardi mpminardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for catching and fixing this!

@mpminardi mpminardi merged commit aa289ad into tailscale:main May 3, 2024
3 checks passed
@keeleysam keeleysam deleted the splitdnsimport branch May 3, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants