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
Page rule priority is compacted after apply, making terraform plan
report changes
#1914
Comments
see #187 where this is covered in detail with workarounds. |
I know of this #187 and I don't think this is the same issue. #187 deals with the fact that load ordering is not deterministically the same as in the file, and priority cannot be used because it gets reshuffled. The case I describe in this issue can not be worked around by the suggested workaround in #187, specifically because I don't have access to all the page rules in my Terraform. I need to insert the rules at specific positions. This is common if you have multiple environments all contributing to the same zone. It would indeed be possible to solve in the provider if Cloudflare is unwilling to support indexes in the API, by doing a read-then-write of the rules, right? |
from #187
the API doesn't support gaps in page rule ordering so the provider won't either. when you apply a change, you need access to all the page rules to successfully apply it. the slight exception here (but not really) is if you have a LTZ setup but that requires liberating a subdomain and the page rules to be subdomain specific. |
Thank you for the response. I read in #187 that you don't want to the read-then-Write for performance reasons. That is understandable. But the segmentation I mention in this issue is not possible to work around the way the the parallel writes are in #187. As long as this issue is not addressed, it means that page rules cannot be split up in environments, which in turn means that page rules cannot be used if having more than one environment (unless using child domain, which in our case our subscription level does not allow). I can possibly solve my problem in a worker so I will try this instead. |
Confirmation
Terraform and Cloudflare provider version
Terraform v1.2.2 on linux_arm64
cloudflare/cloudflare version = "3.23.0"
Affected resource(s)
cloudflare_page_rule
Terraform configuration files
Link to debug output
n/a
Panic output
No response
Expected output
terraform plan
report no changes after being applied.Actual output
Priority is "compacted"
Steps to reproduce
Additional factoids
The need to keep rules priorities is crucial when you have a segmented IaC project where multiple projects/environments are responsible for different parts of a zone. Otherwise I have to beforehand know the exact index where the "previous environment" left off. I need to create ranges with gaps in them to properly and reliably insert priorities into the correct order. This expectation is based on e..g how the azurerm provider works with similar types of resources (compare with app gateway routing rule priorities for example, where the priorities "stick")
References
No response
The text was updated successfully, but these errors were encountered: