thousandeyes / terraform-provider-thousandeyes

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

custom headers for http-server tests are not saved #135

Open berkeli opened 1 year ago

berkeli commented 1 year ago

Hello,

I have another bug to report please, it's related to the way headers and custom_headers args work for http-server test types.

The following is an example test created with terraform:

resource "thousandeyes_http_server" "http_server" {
  .....
  custom_headers = {
    key = "value"
  }
  headers        = ["key: value"]

Problem:

  1. Run terraform apply & plan, This creates test without the given header, which doesn't work as expected.
  2. Go to the dashboard and add headers
  3. If you run terraform plan, it marks headers for modification even if they are the same
  4. Run terraform apply - it removes headers. This can be verified via UI or API

Terraform state thinks headers are present and if we run terraform plan with a modified header, it will show the difference

Terraform will perform the following actions:

  # module.thousandeyes-http_edgeapi_healthcheck["***"].thousandeyes_http_server.http_server will be updated in-place
  ~ resource "thousandeyes_http_server" "http_server" {
      ~ custom_headers         = {
          ~ "host" = "value" -> "value2"
        }
      ~ headers                = [
          - "key: value",
          + "key: value2",
        ]
        id                     = "******"
        # (32 unchanged attributes hidden)

        # (13 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
joaomper-TE commented 8 months ago

Hey @berkeli and sorry or the long wait. Even though the field is there, we currently do not support custom_headers in thousandeyes_http_server resources. We plan on adding it in the near future and will keep you updated.

I'll mark this as an enhancement for now.