Hi, I am using `pulumi` to create cloudflare rate ...
# general
r
Hi, I am using
pulumi
to create cloudflare rate limit rule. here is my code:
Copy code
export const rateLimitRule = new cloudflare.RateLimit("rate-limit-rule", {
    zoneId: <zone-id>,
    threshold: 1200,
    period: 60, // Time period in seconds to evaluate request count (60 seconds = 1 minute)
    action: {
        mode: "ban",
        timeout: 60,
        response: {
            contentType: "text/plain",
            body: "Exceeded rate limit",
        },
    },
    match: {
        request: {
            urlPattern: "<http://test.example.com|test.example.com>",
        },
    },
});
I am using cloudflare
pro
plan and I can create the same rule in cloudflare dashboard. but I get
error creating rate limit for zone: ratelimit.api.not_entitled.account (10021)
which seems I am doing something that is not available in
pro
plan. can some one help me here? Thanks
q
Hi Hasan, the RateLimit resource relates to the legacy cloudflare ratelimiting rules, which requires enterprise and cloudflare support to reenable it https://developers.cloudflare.com/waf/reference/legacy/old-rate-limiting/troubleshooting/. To use the new WAF rate limiting rules, you'll need to use the Ruleset resource https://www.pulumi.com/registry/packages/cloudflare/api-docs/ruleset/
r
Hi Alice, Thanks for your help 🙏 I will try it.