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

Generated cloudflare_zone_settings_override doesn't work out of the box #663

Open
2 tasks done
punkeel opened this issue Jan 8, 2024 · 2 comments
Open
2 tasks done

Comments

@punkeel
Copy link
Member

punkeel commented Jan 8, 2024

Confirmation

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

cf-terraforming version

cf-terraforming 0.17.0

Expected outcome

Generate valid code that Terraform can apply

Actual outcome


│ Error: It is not possible to change Visitor IP settings for this zone. (1025), log_to_cloudflare cannot be modified for this zone (1057), filter_logs_to_cloudflare cannot be modified for this zone (1057), It is not possible to change Orange To Orange settings for this zone. (1024)

│   with cloudflare_zone_settings_override.terraform_managed_resource_...,
│   on zone_settings.tf line 1, in resource "cloudflare_zone_settings_override" "terraform_managed_resource_...":
│    1: resource "cloudflare_zone_settings_override" "terraform_managed_resource_..." {

Generated code (snipped):

resource "cloudflare_zone_settings_override" "terraform_managed_resource_..." {
  zone_id = ...
  settings {
    orange_to_orange            = "off"
    filter_logs_to_cloudflare   = "off"
    visitor_ip                  = "on"
    log_to_cloudflare           = "on"
  }
}

Steps to reproduce

  1. import zone

References

No response

@jacobbednarz
Copy link
Member

cloudflare_zone_settings_override really shouldn't be imported/generated despite their presence here. the way the resource is built has long standing issues and we're attempting to replace it. you're better off creating this resource by hand and only overriding the settings you know have changed to avoid these traps.

those error messages also look like entitlement/subscription issues 🤔 have you confirmed that side is all good?

@punkeel
Copy link
Member Author

punkeel commented Jan 8, 2024

I'm using the block generated by cf-terraforming here, no changes there - hopefully the zone is entitled to what it's already using 😁 (more seriously, I suspect terraform is trying to "apply" the change, as this resource couldn't be imported - which triggers the entitlements checks regardless of the values)

Got it - I'll remove most settings from this generated block, 👍 . (May it be worth adding a comment in the auto generated block to warn users?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants