-
Notifications
You must be signed in to change notification settings - Fork 625
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
Seeing drift while running terraform apply for firewall rules #2881
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Thank you for reporting this issue! For maintainers to dig into issues it is required that all issues include the entirety of This issue has been marked with |
thanks for the issue and sorry to hear you're hitting an issue. looking at your debug output, you can see the API is responding with the
which aligns with what terraform is saying your configuration has drifted from (because you've not defined it).
to me, this suggests you (or someone with access to your zone) has either swapped the rules into priority mode or you've gone over the threshold for implicitly firewall rules and now all firewall rules will be explicitly prioritised - see https://developers.cloudflare.com/firewall/cf-firewall-rules/order-priority/ for an overview of this process. this isn't a bug with the provider and you'll need to rectify this in your configuration. you can either 1) revert the change to using an ordered list (if you haven't crossed the threshold) or 2) you can add the property to your HCL and apply/or import it to get it back into sync. on its own your reproduction case doesn't show this issue and can be easily verified by running the provider test suite or this example. terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
}
}
}
provider "cloudflare" {}
resource "cloudflare_firewall_rule" "example" {
zone_id = var.cloudflare_zone_id
description = "Challenge okhttp/3.8.0 UA on whatever root path /"
filter_id = cloudflare_filter.example.id
action = "challenge"
}
resource "cloudflare_filter" "example" {
zone_id = var.cloudflare_zone_id
description = "Wordpress break-in attempts that are outside of the office"
expression = "true"
}
as this isn't a bug, i'm going to close this off as there isn't any action for us to take further here but let me know if you still have any follow up questions. |
Confirmation
Terraform and Cloudflare provider version
Hello team,
our Terraform configuration for smooch.io zone, 1f78bac08ff99d5ef8455537f554870e id, has some cloudflare_firewall_rule like attached one, but when we run terraform plan we see the priority being changed to null (for it and any other ones), for example:
cloudflare_firewall_rule.rule-number will be updated in-place
~ resource "cloudflare_firewall_rule" "rule-number" {
id = "e823cbe16e324f308c85f16c3fc137d6"
(6 unchanged attributes hidden)
}
This behaviour seems to be happening using both 4.6 and 4.17 versions of the provider. I wonder if there’s anything that changed since this does not happen for other zones that use an older provider version?
Let us know if you need anything else from us.
Thank you,
Alessandro
Affected resource(s)
cloudflare_firewall_rule
Terraform configuration files
Link to debug output
Gist
Panic output
No response
Expected output
We assumed rule priority wouldn't change
Actual output
cloudflare_firewall_rule.rule-number will be updated in-place
~ resource "cloudflare_firewall_rule" "rule-number" {
id = "e823cbe16e324f308c85f16c3fc137d6"
(6 unchanged attributes hidden)
}
Steps to reproduce
The steps to reproduce are simply to run a
terraform plan
on file that containscloudflare_firewall_rule
: it will try to modify the priority even though the value was not changedAdditional factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: