Terraform http_request_redirect failing with missing permissions

What is the name of the domain?

What is the error message?

missing the permissions required to create zone rulesets in the │ http_request_redirect phase at the zone level

What is the issue you’re encountering

I can’t create the rule although I know the token has the right permissions

What are the steps to reproduce the issue?

resource “cloudflare_ruleset” “travel_redirect_ruleset” {
zone_id = cloudflare_zone.ramp.id
name = “travel-redirect-ruleset”
kind = “zone”
phase = “http_request_redirect”

rules {
action = “redirect”
expression = “(http.host eq "<>.ramp.com")”
action_parameters {
from_value {
target_url {
value = “https://app.ramp.com/<>”
}
status_code = 301
}
}
}
}

Screenshot of the error

Correct me if I’m wrong, but it looks like you’re trying to submit a Single Redirect rule (phase http_request_dynamic_redirect) using Bulk Redirects ruleset (http_request_redirect).

It does seem like it. I was able to get the rule created with moving away to the single redirect! Thanks :slight_smile: Now I have another issue which is a 525 error. While travel.ramp.com uses the *.ramp.com cert and app.ramp.com uses its own I could understand the mismatch but I have the CNAME record proxied through cloudflare. If I implement the same thing with page_rule it works but they are going to be deprecated so might as well get this working with the cloudflare_ruleset resource.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.

525 error means your origin didn’t serve SSL certificate to us. Mismatch between hostnames in the request and in the SSL certificate would have caused 526 error instead. :wink:

If your origin doesn’t return SSL certificate, you can force Cloudflare to connect to your origin via port 80 for a specific hostname by setting SSL to Flexible using Configuration Rules.