thousandeyes / terraform-provider-thousandeyes

ThousandEyes Terraform Provider
Apache License 2.0
21 stars 26 forks source link

DNS re-ordering always flagged for modification. #131

Closed berkeli closed 1 year ago

berkeli commented 1 year ago

Hello,

We are creating thousandeyes_dns_server tests with custom list of dns_servers using a dynamic block. Code below:

dns_servers = ["8.8.8.8", "8.8.4.4", "208.67.222.222", "1.1.1.1", "9.9.9.9", "12.121.117.201", "204.117.214.10", "77.88.8.8", "74.82.42.42", "195.46.39.39"]

....

resource "thousandeyes_dns_server" "dns_lookup" {
...
  dynamic "dns_servers" {
    for_each = local.dns_servers
    content {
      server_name = dns_servers.value
    }
  }
}

This creates tests fine, but on every subsequent plan/apply output the same test is marked for modification due to re-ordering (sorted by id mismatch with sorted by name?)

resource "thousandeyes_dns_server" "dns_lookup" {
14:14:04         # (26 unchanged attributes hidden)
14:14:04 
14:14:04       ~ dns_servers {
14:14:04           ~ server_name = "8.8.8.8" -> "1.1.1.1"
14:14:04             # (1 unchanged attribute hidden)
14:14:04         }
14:14:04       ~ dns_servers {
14:14:04           ~ server_name = "208.67.222.222" -> "12.121.117.201"
14:14:04             # (1 unchanged attribute hidden)
14:14:04         }
14:14:04       ~ dns_servers {
14:14:04           ~ server_name = "8.8.4.4" -> "195.46.39.39"
14:14:04             # (1 unchanged attribute hidden)
14:14:04         }
14:14:04       ~ dns_servers {
14:14:04           ~ server_name = "74.82.42.42" -> "204.117.214.10"
14:14:04             # (1 unchanged attribute hidden)
14:14:04         }
14:14:04       ~ dns_servers {
14:14:04           ~ server_name = "195.46.39.39" -> "208.67.222.222"
14:14:04             # (1 unchanged attribute hidden)
14:14:04         }
14:14:04       ~ dns_servers {
14:14:04           ~ server_name = "1.1.1.1" -> "74.82.42.42"
14:14:04             # (1 unchanged attribute hidden)
14:14:04         }
14:14:04       ~ dns_servers {
14:14:04           ~ server_name = "9.9.9.9" -> "77.88.8.8"
14:14:04             # (1 unchanged attribute hidden)
14:14:04         }
14:14:04       ~ dns_servers {
14:14:04           ~ server_name = "77.88.8.8" -> "8.8.4.4"
14:14:04             # (1 unchanged attribute hidden)
14:14:04         }
14:14:04       ~ dns_servers {
14:14:04           ~ server_name = "12.121.117.201" -> "8.8.8.8"
14:14:04             # (1 unchanged attribute hidden)
14:14:04         }
14:14:04       ~ dns_servers {
14:14:04           ~ server_name = "204.117.214.10" -> "9.9.9.9"
14:14:04             # (1 unchanged attribute hidden)
14:14:04         }
14:14:04 
14:14:04         # (8 unchanged blocks hidden)
14:14:04     }

Is there a workaround this? We have quite many tests, so this can get a bit annoying.

Thanks!

pedro-te commented 1 year ago

Hi @berkeli ,

Apologies for the inconvenience that this is causing. I believe the fix should be simple, we will look into this soon and will get back to you once we have updates.

Thanks, Pedro

pedro-te commented 1 year ago

Hi @berkeli ,

A new version has been released which should address this bug. Can you give it a try and let us know, please? v2.0.1

Thank you, Pedro

berkeli commented 1 year ago

@pedro-te Thank you very much, will give it a try today

berkeli commented 1 year ago

fixed with v2.0.1