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 update a managed request header from true to false on cloudflare_managed_headers #2806

Open
2 tasks done
nialdaly opened this issue Sep 29, 2023 · 3 comments
Open
2 tasks done
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. triage/accepted Indicates an issue or PR is ready to be actively worked on. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log.

Comments

@nialdaly
Copy link

nialdaly commented Sep 29, 2023

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

Terraform v1.5.7
on darwin_arm64

  • provider registry.terraform.io/cloudflare/cloudflare v4.15.0

Affected resource(s)

  • cloudflare_managed_headers

Terraform configuration files

resource "cloudflare_managed_headers" "managed_headers" {
  zone_id = data.cloudflare_zone.zone.id

  managed_request_headers {
    id      = "add_client_certificate_headers"
    enabled = false
  }
}

Link to debug output

https://gist.github.com/nialdaly/a3f6924e3812791a0e6bdf4d23157ca1

Panic output

No response

Expected output

  • I expected the Add TLS client auth headers request header to be marked as disabled.

Actual output

  • The Add TLS client auth headers request header is marked as enabled.
Screenshot 2023-09-29 at 16 22 19

Steps to reproduce

  • Create a cloudflare_managed_headers resource with the following configuration:
    resource "cloudflare_managed_headers" "managed_headers" {
       zone_id = data.cloudflare_zone.zone.id
    
       managed_request_headers {
         id      = "add_client_certificate_headers"
        enabled = true
      }
    }
    
  • Run terraform apply.
  • Update the cloudflare_managed_headers resource to the following configuration:
    resource "cloudflare_managed_headers" "managed_headers" {
       zone_id = data.cloudflare_zone.zone.id
    
       managed_request_headers {
         id      = "add_client_certificate_headers"
        enabled = false
      }
    }
    
  • Run terraform apply.
  • The Add TLS client auth headers request header is marked as enabled when it should be now disabled.

Additional factoids

No response

References

No response

@nialdaly nialdaly added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 29, 2023
@github-actions
Copy link
Contributor

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. label Sep 29, 2023
@jacobbednarz
Copy link
Member

jacobbednarz commented Oct 1, 2023

this is unfortunately a known issue with swapping between zero values in Terraform SDKv2. we can mitigate it by migrating to the plugin framework however i do not have an ETA on when that will happen. in the meantime, to swap the value you will need to remove it from your state file, and reapply it with the false value set.

@jacobbednarz jacobbednarz added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Oct 1, 2023
@nialdaly
Copy link
Author

nialdaly commented Oct 1, 2023

Hi @jacobbednarz! Thanks for the prompt response, makes sense. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. triage/accepted Indicates an issue or PR is ready to be actively worked on. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log.
Projects
None yet
Development

No branches or pull requests

2 participants