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

Unable to remove action = "pass" on request setting #683

Open
jonnangle opened this issue Apr 19, 2023 · 0 comments
Open

Unable to remove action = "pass" on request setting #683

jonnangle opened this issue Apr 19, 2023 · 0 comments
Labels

Comments

@jonnangle
Copy link

Terraform Version

Terraform v1.3.3
on darwin_arm64
+ provider registry.terraform.io/fastly/fastly v3.2.0
+ provider registry.terraform.io/hashicorp/null v3.2.1
+ provider registry.terraform.io/signalsciences/sigsci v1.2.13

Affected Fastly Terraform Resource(s)

  • fastly_service_vcl

Terraform Configuration Files

If I have a request condition with action = pass, and I try to remove the action to get back to the default caching behaviour, I get a correct plan but it does not get applied.

  ~ resource "fastly_service_vcl" "this" {
      ~ active_version     = 13 -> (known after apply)
      ~ cloned_version     = 13 -> (known after apply)
        id                 = "XXX"
        name               = "my-service"
        # (8 unchanged attributes hidden)

      + request_setting {
          + force_ssl = true
          + name      = "Generated by force TLS and enable HSTS"
          + xff       = "append"
        }
      - request_setting {
          - action           = "pass" -> null
Linting
          - bypass_busy_wait = false -> null
          - force_miss       = false -> null
          - force_ssl        = true -> null
          - geo_headers      = false -> null
          - max_stale_age    = 0 -> null
          - name             = "Generated by force TLS and enable HSTS" -> null
          - timer_support    = false -> null
          - xff              = "append" -> null
        }

        # (21 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Expected Behavior

The request_setting should be updated to remove the action as per the plan.

Actual Behavior

After terraform apply, a new version gets activated with no changes and a subsequent terraform plan shows the same plan as before.

Steps to Reproduce

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

  1. Add a request setting with action set
  2. terraform apply
  3. Remove the action line from the request setting
  4. terraform apply

Important Factoids (optional)

I've tried doing a PUT to https://api.fastly.com/service/<id>/version/<version>/request_settings/Generated%20by%20force%20TLS%20and%20enable%20HSTS' -d 'action='

and that works fine - so possibly what's needed is support for a third option gofastly.RequestSettingActionNone here?

https://github.com/fastly/terraform-provider-fastly/blob/main/fastly/block_fastly_service_requestsetting.go#L166-L173

@Integralist Integralist added the bug label Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants