terraform-provider-fastly icon indicating copy to clipboard operation
terraform-provider-fastly copied to clipboard

request_setting imports incorrectly

Open agilgur5 opened this issue 6 years ago • 2 comments

When I imported a request_setting and then ran a plan against it, it showed that parts of the request_setting started as false when they actually were unset / blank on Fastly ( "" ). Wasn't exactly sure where / what caused this problem so couldn't PR it myself

Terraform Version

v0.10.7

Affected Resource(s)

fastly_service_v1.request_setting, more specifically it would seem to be a problem importing (or updating?):

  • bypass_busy_wait
  • force_miss
  • force_ssl
  • geo_headers
  • timer_support

Expected Behavior

I terraform import a request_setting that has those 5 unset / blank. I run a terraform plan and it says they began as "".

Actual Behavior

I terraform imported a request_setting that had those 5 unset / blank. When I ran a terraform plan it said they began instead as false, which is incorrect. Below is a part of the plan output that demonstrates this:

      request_setting.xxx.action:            "" => ""
      request_setting.xxx.bypass_busy_wait:  "false" => ""
      request_setting.xxx.default_host:      "foo.com" => "foo.com"
      request_setting.xxx.force_miss:        "false" => ""
      request_setting.xxx.force_ssl:         "false" => ""
      request_setting.xxx.geo_headers:       "false" => ""
      request_setting.xxx.hash_keys:         "" => ""
      request_setting.xxx.max_stale_age:     "0" => "60"
      request_setting.xxx.name:              "foo" => "foo"
      request_setting.xxx.request_condition: "conditional foo" => "conditional foo"
      request_setting.xxx.timer_support:     "false" => ""

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform import with those 5 unset / blank
  2. terraform plan with those 5

agilgur5 avatar Oct 11 '17 02:10 agilgur5

Not sure if this is just an import or an update problem, might be a bug in the Go SDK or perhaps even more likely the API itself. After applying the plan (which has each of the 5 set to ""), Fastly gives me a very different result: it set all 5 to '0'... which is neither the correct unset / blank value nor the incorrect false value...

See below screenshot for diff from Fastly UI

screen shot 2017-10-18 at 7 29 59 pm

The code uses the CBool / Compatibool type from the Go SDK correctly and the settings seem to be correct, so I'm summarily confused now

agilgur5 avatar Oct 19 '17 04:10 agilgur5

I have same issue (version 0.10.8 and 0.11.3), do we have any update from HashiCorp?

goldver avatar Mar 22 '18 13:03 goldver

Closing as stale. Please open a new issue after testing with the latest Terraform provider if this is still an issue. Thanks.

Integralist avatar Sep 28 '22 14:09 Integralist