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

Cloudflare_ruleset - http_ratelimit - mitigation_timeout missing #2914

Closed
2 tasks done
ThomasAusweger opened this issue Nov 7, 2023 · 4 comments
Closed
2 tasks done
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@ThomasAusweger
Copy link

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

cloudflare/cloudflare v4.18.0

Affected resource(s)

cloudflare_ruleset

Terraform configuration files

resource "cloudflare_ruleset" "firewall_ratelimit" {
  kind    = "zone"
  name    = "default"
  phase   = "http_ratelimit"
  zone_id = var.zone_id

  rules {
    description  = "log_adv_ratelimit"
    expression   = "***********"
    action       = "managed_challenge"
    enabled      = true
    ratelimit {
      characteristics     = ["ip.src", "cf.colo.id"]
      period              = 60
      requests_per_period = 600
      requests_to_origin  = false
    }
  }
}

Link to debug output

Panic output

│ Error: Provider produced inconsistent result after apply

│ When applying changes to
│ module.****.cloudflare_ruleset.firewall_ratelimit, provider
│ "provider["registry.terraform.io/cloudflare/cloudflare"]" produced an
│ unexpected new value: .rules[0].ratelimit[0].mitigation_timeout: was null,
│ but now cty.NumberIntVal(0).

│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

Expected output

No error

Actual output

terraform apply reported error

Steps to reproduce

  1. Update to v4.18.0
  2. Add cloudflare_ruleset for http_ratelimit with managed_challenge
  3. No mitigation_timeout needed for managed_challenge in v4.17.0

Additional factoids

No response

References

https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/CHANGELOG.md#4180-1st-november-2023

@ThomasAusweger ThomasAusweger 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 Nov 7, 2023
Copy link
Contributor

github-actions bot commented Nov 7, 2023

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.

Copy link
Contributor

github-actions bot commented Nov 7, 2023

Thank you for reporting this issue! For maintainers to dig into issues it is required that all issues include the entirety of TF_LOG=DEBUG output to be provided. The only parts that should be redacted are your user credentials in the X-Auth-Key, X-Auth-Email and Authorization HTTP headers. Details such as zone or account identifiers are not considered sensitive but can be redacted if you are very cautious. This log file provides additional context from Terraform, the provider and the Cloudflare API that helps in debugging issues. Without it, maintainers are very limited in what they can do and may hamper diagnosis efforts.

This issue has been marked with triage/needs-information and is unlikely to receive maintainer attention until the log file is provided making this a complete bug report.

@github-actions github-actions bot added triage/needs-information Indicates an issue needs more information in order to work on it. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 7, 2023
@vences
Copy link
Contributor

vences commented Nov 27, 2023

Hey @ThomasAusweger,

I think you need to explicitly set mitigation_timeout = 0 if you want to have the throttle action (as per the doc here). If you do not want that behaviour you will need to select the mitigation time allow as per your plan (doc here).

Could you please let me know if having explicitly set mitigation_timeout, solved your issue? If so I think that field would need to be set as required.

Hope that helps,

@ThomasAusweger
Copy link
Author

Thanks for the answer.

Ich checked today and now I have to set in the GUI for the managed_challenge a mitigation_timeout as well.
Last month it was not needed and set default to null.

So all is working and consistent now.

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. triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

No branches or pull requests

2 participants