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

image_resizing for cloudflare_zone_settings_override doesn't make changes #961

Closed
ChristophShyper opened this issue Feb 19, 2021 · 8 comments
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.

Comments

@ChristophShyper
Copy link
Contributor

Terraform version

Terraform v0.14.5

Affected resource(s)

cloudflare_zone_settings_override

Terraform configuration files

resource "cloudflare_zone_settings_override" "config_override" {
  zone_id = cloudflare_zone.this.id

  settings {
   (...)
   image_resizing  = "on"
   (...)
  }
}

Debug output

Error: invalid zone setting "image_resizing" (value: ) found - cannot be set as it is read only

Expected behavior

Image resizing option should be enabled.

Actual behavior

Image resizing is still off.

Steps to reproduce

  1. Create zone with image resizing turned off
  2. Add cloudflare_zone_settings_override to your terraform with current values
  3. terraform apply works
  4. Change image_resizing to off

We have Enterprise plan, so it's possible to set it.
Setting it manually in Cloudflare solves the error, but we want to control it from code.

References

Community note

  • Please vote on this issue by adding a 👍 reaction
    to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull
    request, please leave a comment
@ChristophShyper ChristophShyper 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 Feb 19, 2021
@olenm
Copy link

olenm commented Feb 24, 2021

On a new hosted-zone and on attempting to enable the "override" settings for the first time - I have image_resizing off in TF (and it is certainly off in the web-ui) and I too, get the read-only error.

@alxsbn
Copy link

alxsbn commented Mar 10, 2021

I have the same behavior with webp and http2

Cloudflare_zone_settings_override.settings: Creating...

Error: invalid zone setting "http2" (value: off) found - cannot be set as it is read only

TF try to destroy then create a new zone settings override but some parameters seems blocked as they're flagged as 'read only'. I also have the same error with webp.

@vital4ik
Copy link

I get this too, works on some zones but not others with different values

@jacobbednarz
Copy link
Member

i've found an internal reference stating this has been addressed. @alxsbn can you please confirm if you're still seeing the issue?

@kawikao
Copy link

kawikao commented Apr 23, 2021

I have this problem too. I'm on the Cloudflare free plan and I notice some of the read-only settings that error are only available on the Cloudflare enterprise plan or for a service I don't have enabled.

This is a fatal error because when trying to delete the resource, it tries to update settings at Cloudflare marked as read-only which causes the delete to fail. So, I can't update a read-only setting with the existing value or null and I can't delete the resource. It's essentially a zombie resource that will never update or go away.

My suggestion is to skip trying to update read-only settings.

@kawikao
Copy link

kawikao commented Apr 27, 2021

I upgraded my Cloudflare zone to Enterprise and a whole slew of read-only settings went away except paid services like Image Resizing, DDOS and AST.

The provider should not be trying to update a Cloudflare service that the zone is not subscribed too. The request will be blocked. Need a workaround or a fix. Thanks.

@jacobbednarz
Copy link
Member

No @kawikao, yours is not a bug. The resource is intended as an override to the defaults and if you do not have entitlements, the resource is not aware of it. It is not a resource intended to manage all resources irrespective of the entitlements.

@kawikao
Copy link

kawikao commented May 7, 2021

From the docs.

Note that after destroying this resource Zone Settings will be reset to their initial values.

I took it to mean, the provider tries to reset the initial values at Cloudflare. Since, many settings are read-only, it doesn't appear to even try to reset the values and aborts destroying the resource. It's a catch-22. I just terraform rm and won't use the resource until this issue is resolved.

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.
Projects
None yet
Development

No branches or pull requests

6 participants