Skip to content

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

@jonnangle

Description

@jonnangle

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions