Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi
cloudflare.getRateLimits
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const exampleRateLimits = cloudflare.getRateLimits({
zoneId: "023e105f4ecef8ad9ca31a8372d0c353",
});
import pulumi
import pulumi_cloudflare as cloudflare
example_rate_limits = cloudflare.get_rate_limits(zone_id="023e105f4ecef8ad9ca31a8372d0c353")
package main
import (
"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloudflare.LookupRateLimits(ctx, &cloudflare.LookupRateLimitsArgs{
ZoneId: "023e105f4ecef8ad9ca31a8372d0c353",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
var exampleRateLimits = Cloudflare.GetRateLimits.Invoke(new()
{
ZoneId = "023e105f4ecef8ad9ca31a8372d0c353",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.CloudflareFunctions;
import com.pulumi.cloudflare.inputs.GetRateLimitsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var exampleRateLimits = CloudflareFunctions.getRateLimits(GetRateLimitsArgs.builder()
.zoneId("023e105f4ecef8ad9ca31a8372d0c353")
.build());
}
}
variables:
exampleRateLimits:
fn::invoke:
function: cloudflare:getRateLimits
arguments:
zoneId: 023e105f4ecef8ad9ca31a8372d0c353
Using getRateLimits
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getRateLimits(args: GetRateLimitsArgs, opts?: InvokeOptions): Promise<GetRateLimitsResult>
function getRateLimitsOutput(args: GetRateLimitsOutputArgs, opts?: InvokeOptions): Output<GetRateLimitsResult>
def get_rate_limits(max_items: Optional[int] = None,
zone_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRateLimitsResult
def get_rate_limits_output(max_items: Optional[pulumi.Input[int]] = None,
zone_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRateLimitsResult]
func LookupRateLimits(ctx *Context, args *LookupRateLimitsArgs, opts ...InvokeOption) (*LookupRateLimitsResult, error)
func LookupRateLimitsOutput(ctx *Context, args *LookupRateLimitsOutputArgs, opts ...InvokeOption) LookupRateLimitsResultOutput
> Note: This function is named LookupRateLimits
in the Go SDK.
public static class GetRateLimits
{
public static Task<GetRateLimitsResult> InvokeAsync(GetRateLimitsArgs args, InvokeOptions? opts = null)
public static Output<GetRateLimitsResult> Invoke(GetRateLimitsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRateLimitsResult> getRateLimits(GetRateLimitsArgs args, InvokeOptions options)
public static Output<GetRateLimitsResult> getRateLimits(GetRateLimitsArgs args, InvokeOptions options)
fn::invoke:
function: cloudflare:index/getRateLimits:getRateLimits
arguments:
# arguments dictionary
The following arguments are supported:
getRateLimits Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Results
List<Get
Rate Limits Result> - The items returned by the data source
- Zone
Id string - Identifier
- Max
Items int - Max items to fetch, default: 1000
- Id string
- The provider-assigned unique ID for this managed resource.
- Results
[]Get
Rate Limits Result - The items returned by the data source
- Zone
Id string - Identifier
- Max
Items int - Max items to fetch, default: 1000
- id String
- The provider-assigned unique ID for this managed resource.
- results
List<Get
Rate Limits Result> - The items returned by the data source
- zone
Id String - Identifier
- max
Items Integer - Max items to fetch, default: 1000
- id string
- The provider-assigned unique ID for this managed resource.
- results
Get
Rate Limits Result[] - The items returned by the data source
- zone
Id string - Identifier
- max
Items number - Max items to fetch, default: 1000
- id str
- The provider-assigned unique ID for this managed resource.
- results
Sequence[Get
Rate Limits Result] - The items returned by the data source
- zone_
id str - Identifier
- max_
items int - Max items to fetch, default: 1000
- id String
- The provider-assigned unique ID for this managed resource.
- results List<Property Map>
- The items returned by the data source
- zone
Id String - Identifier
- max
Items Number - Max items to fetch, default: 1000
Supporting Types
GetRateLimitsResult
- Action
Get
Rate Limits Result Action - The action to perform when the threshold of matched traffic within the configured period is exceeded.
- Bypasses
List<Get
Rate Limits Result Bypass> - Criteria specifying when the current rate limit should be bypassed. You can specify that the rate limit should not apply to one or more URLs.
- Description string
- An informative summary of the rate limit. This value is sanitized and any tags will be removed.
- Disabled bool
- When true, indicates that the rate limit is currently disabled.
- Id string
- The unique identifier of the rate limit.
- Match
Get
Rate Limits Result Match - Determines which traffic the rate limit counts towards the threshold.
- Period double
- The time in seconds (an integer value) to count matching traffic. If the count exceeds the configured threshold within this period, Cloudflare will perform the configured action.
- Threshold double
- The threshold that will trigger the configured mitigation action. Configure this value along with the
period
property to establish a threshold per period.
- Action
Get
Rate Limits Result Action - The action to perform when the threshold of matched traffic within the configured period is exceeded.
- Bypasses
[]Get
Rate Limits Result Bypass - Criteria specifying when the current rate limit should be bypassed. You can specify that the rate limit should not apply to one or more URLs.
- Description string
- An informative summary of the rate limit. This value is sanitized and any tags will be removed.
- Disabled bool
- When true, indicates that the rate limit is currently disabled.
- Id string
- The unique identifier of the rate limit.
- Match
Get
Rate Limits Result Match - Determines which traffic the rate limit counts towards the threshold.
- Period float64
- The time in seconds (an integer value) to count matching traffic. If the count exceeds the configured threshold within this period, Cloudflare will perform the configured action.
- Threshold float64
- The threshold that will trigger the configured mitigation action. Configure this value along with the
period
property to establish a threshold per period.
- action
Get
Rate Limits Result Action - The action to perform when the threshold of matched traffic within the configured period is exceeded.
- bypasses
List<Get
Rate Limits Result Bypass> - Criteria specifying when the current rate limit should be bypassed. You can specify that the rate limit should not apply to one or more URLs.
- description String
- An informative summary of the rate limit. This value is sanitized and any tags will be removed.
- disabled Boolean
- When true, indicates that the rate limit is currently disabled.
- id String
- The unique identifier of the rate limit.
- match
Get
Rate Limits Result Match - Determines which traffic the rate limit counts towards the threshold.
- period Double
- The time in seconds (an integer value) to count matching traffic. If the count exceeds the configured threshold within this period, Cloudflare will perform the configured action.
- threshold Double
- The threshold that will trigger the configured mitigation action. Configure this value along with the
period
property to establish a threshold per period.
- action
Get
Rate Limits Result Action - The action to perform when the threshold of matched traffic within the configured period is exceeded.
- bypasses
Get
Rate Limits Result Bypass[] - Criteria specifying when the current rate limit should be bypassed. You can specify that the rate limit should not apply to one or more URLs.
- description string
- An informative summary of the rate limit. This value is sanitized and any tags will be removed.
- disabled boolean
- When true, indicates that the rate limit is currently disabled.
- id string
- The unique identifier of the rate limit.
- match
Get
Rate Limits Result Match - Determines which traffic the rate limit counts towards the threshold.
- period number
- The time in seconds (an integer value) to count matching traffic. If the count exceeds the configured threshold within this period, Cloudflare will perform the configured action.
- threshold number
- The threshold that will trigger the configured mitigation action. Configure this value along with the
period
property to establish a threshold per period.
- action
Get
Rate Limits Result Action - The action to perform when the threshold of matched traffic within the configured period is exceeded.
- bypasses
Sequence[Get
Rate Limits Result Bypass] - Criteria specifying when the current rate limit should be bypassed. You can specify that the rate limit should not apply to one or more URLs.
- description str
- An informative summary of the rate limit. This value is sanitized and any tags will be removed.
- disabled bool
- When true, indicates that the rate limit is currently disabled.
- id str
- The unique identifier of the rate limit.
- match
Get
Rate Limits Result Match - Determines which traffic the rate limit counts towards the threshold.
- period float
- The time in seconds (an integer value) to count matching traffic. If the count exceeds the configured threshold within this period, Cloudflare will perform the configured action.
- threshold float
- The threshold that will trigger the configured mitigation action. Configure this value along with the
period
property to establish a threshold per period.
- action Property Map
- The action to perform when the threshold of matched traffic within the configured period is exceeded.
- bypasses List<Property Map>
- Criteria specifying when the current rate limit should be bypassed. You can specify that the rate limit should not apply to one or more URLs.
- description String
- An informative summary of the rate limit. This value is sanitized and any tags will be removed.
- disabled Boolean
- When true, indicates that the rate limit is currently disabled.
- id String
- The unique identifier of the rate limit.
- match Property Map
- Determines which traffic the rate limit counts towards the threshold.
- period Number
- The time in seconds (an integer value) to count matching traffic. If the count exceeds the configured threshold within this period, Cloudflare will perform the configured action.
- threshold Number
- The threshold that will trigger the configured mitigation action. Configure this value along with the
period
property to establish a threshold per period.
GetRateLimitsResultAction
- Mode string
- The action to perform. Available values: "simulate", "ban", "challenge", "jschallenge", "managedchallenge".
- Response
Get
Rate Limits Result Action Response - A custom content type and reponse to return when the threshold is exceeded. The custom response configured in this object will override the custom error for the zone. This object is optional. Notes: If you omit this object, Cloudflare will use the default HTML error page. If "mode" is "challenge", "managedchallenge", or "jschallenge", Cloudflare will use the zone challenge pages and you should not provide the "response" object.
- Timeout double
- The time in seconds during which Cloudflare will perform the mitigation action. Must be an integer value greater than or equal to the period. Notes: If "mode" is "challenge", "managedchallenge", or "jschallenge", Cloudflare will use the zone's Challenge Passage time and you should not provide this value.
- Mode string
- The action to perform. Available values: "simulate", "ban", "challenge", "jschallenge", "managedchallenge".
- Response
Get
Rate Limits Result Action Response - A custom content type and reponse to return when the threshold is exceeded. The custom response configured in this object will override the custom error for the zone. This object is optional. Notes: If you omit this object, Cloudflare will use the default HTML error page. If "mode" is "challenge", "managedchallenge", or "jschallenge", Cloudflare will use the zone challenge pages and you should not provide the "response" object.
- Timeout float64
- The time in seconds during which Cloudflare will perform the mitigation action. Must be an integer value greater than or equal to the period. Notes: If "mode" is "challenge", "managedchallenge", or "jschallenge", Cloudflare will use the zone's Challenge Passage time and you should not provide this value.
- mode String
- The action to perform. Available values: "simulate", "ban", "challenge", "jschallenge", "managedchallenge".
- response
Get
Rate Limits Result Action Response - A custom content type and reponse to return when the threshold is exceeded. The custom response configured in this object will override the custom error for the zone. This object is optional. Notes: If you omit this object, Cloudflare will use the default HTML error page. If "mode" is "challenge", "managedchallenge", or "jschallenge", Cloudflare will use the zone challenge pages and you should not provide the "response" object.
- timeout Double
- The time in seconds during which Cloudflare will perform the mitigation action. Must be an integer value greater than or equal to the period. Notes: If "mode" is "challenge", "managedchallenge", or "jschallenge", Cloudflare will use the zone's Challenge Passage time and you should not provide this value.
- mode string
- The action to perform. Available values: "simulate", "ban", "challenge", "jschallenge", "managedchallenge".
- response
Get
Rate Limits Result Action Response - A custom content type and reponse to return when the threshold is exceeded. The custom response configured in this object will override the custom error for the zone. This object is optional. Notes: If you omit this object, Cloudflare will use the default HTML error page. If "mode" is "challenge", "managedchallenge", or "jschallenge", Cloudflare will use the zone challenge pages and you should not provide the "response" object.
- timeout number
- The time in seconds during which Cloudflare will perform the mitigation action. Must be an integer value greater than or equal to the period. Notes: If "mode" is "challenge", "managedchallenge", or "jschallenge", Cloudflare will use the zone's Challenge Passage time and you should not provide this value.
- mode str
- The action to perform. Available values: "simulate", "ban", "challenge", "jschallenge", "managedchallenge".
- response
Get
Rate Limits Result Action Response - A custom content type and reponse to return when the threshold is exceeded. The custom response configured in this object will override the custom error for the zone. This object is optional. Notes: If you omit this object, Cloudflare will use the default HTML error page. If "mode" is "challenge", "managedchallenge", or "jschallenge", Cloudflare will use the zone challenge pages and you should not provide the "response" object.
- timeout float
- The time in seconds during which Cloudflare will perform the mitigation action. Must be an integer value greater than or equal to the period. Notes: If "mode" is "challenge", "managedchallenge", or "jschallenge", Cloudflare will use the zone's Challenge Passage time and you should not provide this value.
- mode String
- The action to perform. Available values: "simulate", "ban", "challenge", "jschallenge", "managedchallenge".
- response Property Map
- A custom content type and reponse to return when the threshold is exceeded. The custom response configured in this object will override the custom error for the zone. This object is optional. Notes: If you omit this object, Cloudflare will use the default HTML error page. If "mode" is "challenge", "managedchallenge", or "jschallenge", Cloudflare will use the zone challenge pages and you should not provide the "response" object.
- timeout Number
- The time in seconds during which Cloudflare will perform the mitigation action. Must be an integer value greater than or equal to the period. Notes: If "mode" is "challenge", "managedchallenge", or "jschallenge", Cloudflare will use the zone's Challenge Passage time and you should not provide this value.
GetRateLimitsResultActionResponse
- Body string
- The response body to return. The value must conform to the configured content type.
- Content
Type string - The content type of the body. Must be one of the following:
text/plain
,text/xml
, orapplication/json
.
- Body string
- The response body to return. The value must conform to the configured content type.
- Content
Type string - The content type of the body. Must be one of the following:
text/plain
,text/xml
, orapplication/json
.
- body String
- The response body to return. The value must conform to the configured content type.
- content
Type String - The content type of the body. Must be one of the following:
text/plain
,text/xml
, orapplication/json
.
- body string
- The response body to return. The value must conform to the configured content type.
- content
Type string - The content type of the body. Must be one of the following:
text/plain
,text/xml
, orapplication/json
.
- body str
- The response body to return. The value must conform to the configured content type.
- content_
type str - The content type of the body. Must be one of the following:
text/plain
,text/xml
, orapplication/json
.
- body String
- The response body to return. The value must conform to the configured content type.
- content
Type String - The content type of the body. Must be one of the following:
text/plain
,text/xml
, orapplication/json
.
GetRateLimitsResultBypass
GetRateLimitsResultMatch
GetRateLimitsResultMatchHeader
GetRateLimitsResultMatchRequest
- Methods List<string>
- The HTTP methods to match. You can specify a subset (for example,
['POST','PUT']
) or all methods (['_ALL_']
). This field is optional when creating a rate limit. - Schemes List<string>
- The HTTP schemes to match. You can specify one scheme (
['HTTPS']
), both schemes (['HTTP','HTTPS']
), or all schemes (['_ALL_']
). This field is optional. - Url string
- The URL pattern to match, composed of a host and a path such as
example.org/path*
. Normalization is applied before the pattern is matched.*
wildcards are expanded to match applicable traffic. Query strings are not matched. Set the value to*
to match all traffic to your zone.
- Methods []string
- The HTTP methods to match. You can specify a subset (for example,
['POST','PUT']
) or all methods (['_ALL_']
). This field is optional when creating a rate limit. - Schemes []string
- The HTTP schemes to match. You can specify one scheme (
['HTTPS']
), both schemes (['HTTP','HTTPS']
), or all schemes (['_ALL_']
). This field is optional. - Url string
- The URL pattern to match, composed of a host and a path such as
example.org/path*
. Normalization is applied before the pattern is matched.*
wildcards are expanded to match applicable traffic. Query strings are not matched. Set the value to*
to match all traffic to your zone.
- methods List<String>
- The HTTP methods to match. You can specify a subset (for example,
['POST','PUT']
) or all methods (['_ALL_']
). This field is optional when creating a rate limit. - schemes List<String>
- The HTTP schemes to match. You can specify one scheme (
['HTTPS']
), both schemes (['HTTP','HTTPS']
), or all schemes (['_ALL_']
). This field is optional. - url String
- The URL pattern to match, composed of a host and a path such as
example.org/path*
. Normalization is applied before the pattern is matched.*
wildcards are expanded to match applicable traffic. Query strings are not matched. Set the value to*
to match all traffic to your zone.
- methods string[]
- The HTTP methods to match. You can specify a subset (for example,
['POST','PUT']
) or all methods (['_ALL_']
). This field is optional when creating a rate limit. - schemes string[]
- The HTTP schemes to match. You can specify one scheme (
['HTTPS']
), both schemes (['HTTP','HTTPS']
), or all schemes (['_ALL_']
). This field is optional. - url string
- The URL pattern to match, composed of a host and a path such as
example.org/path*
. Normalization is applied before the pattern is matched.*
wildcards are expanded to match applicable traffic. Query strings are not matched. Set the value to*
to match all traffic to your zone.
- methods Sequence[str]
- The HTTP methods to match. You can specify a subset (for example,
['POST','PUT']
) or all methods (['_ALL_']
). This field is optional when creating a rate limit. - schemes Sequence[str]
- The HTTP schemes to match. You can specify one scheme (
['HTTPS']
), both schemes (['HTTP','HTTPS']
), or all schemes (['_ALL_']
). This field is optional. - url str
- The URL pattern to match, composed of a host and a path such as
example.org/path*
. Normalization is applied before the pattern is matched.*
wildcards are expanded to match applicable traffic. Query strings are not matched. Set the value to*
to match all traffic to your zone.
- methods List<String>
- The HTTP methods to match. You can specify a subset (for example,
['POST','PUT']
) or all methods (['_ALL_']
). This field is optional when creating a rate limit. - schemes List<String>
- The HTTP schemes to match. You can specify one scheme (
['HTTPS']
), both schemes (['HTTP','HTTPS']
), or all schemes (['_ALL_']
). This field is optional. - url String
- The URL pattern to match, composed of a host and a path such as
example.org/path*
. Normalization is applied before the pattern is matched.*
wildcards are expanded to match applicable traffic. Query strings are not matched. Set the value to*
to match all traffic to your zone.
GetRateLimitsResultMatchResponse
- Origin
Traffic bool - When true, only the uncached traffic served from your origin servers will count towards rate limiting. In this case, any cached traffic served by Cloudflare will not count towards rate limiting. This field is optional. Notes: This field is deprecated. Instead, use response headers and set "origintraffic" to "false" to avoid legacy behaviour interacting with the "responseheaders" property.
- Origin
Traffic bool - When true, only the uncached traffic served from your origin servers will count towards rate limiting. In this case, any cached traffic served by Cloudflare will not count towards rate limiting. This field is optional. Notes: This field is deprecated. Instead, use response headers and set "origintraffic" to "false" to avoid legacy behaviour interacting with the "responseheaders" property.
- origin
Traffic Boolean - When true, only the uncached traffic served from your origin servers will count towards rate limiting. In this case, any cached traffic served by Cloudflare will not count towards rate limiting. This field is optional. Notes: This field is deprecated. Instead, use response headers and set "origintraffic" to "false" to avoid legacy behaviour interacting with the "responseheaders" property.
- origin
Traffic boolean - When true, only the uncached traffic served from your origin servers will count towards rate limiting. In this case, any cached traffic served by Cloudflare will not count towards rate limiting. This field is optional. Notes: This field is deprecated. Instead, use response headers and set "origintraffic" to "false" to avoid legacy behaviour interacting with the "responseheaders" property.
- origin_
traffic bool - When true, only the uncached traffic served from your origin servers will count towards rate limiting. In this case, any cached traffic served by Cloudflare will not count towards rate limiting. This field is optional. Notes: This field is deprecated. Instead, use response headers and set "origintraffic" to "false" to avoid legacy behaviour interacting with the "responseheaders" property.
- origin
Traffic Boolean - When true, only the uncached traffic served from your origin servers will count towards rate limiting. In this case, any cached traffic served by Cloudflare will not count towards rate limiting. This field is optional. Notes: This field is deprecated. Instead, use response headers and set "origintraffic" to "false" to avoid legacy behaviour interacting with the "responseheaders" property.
Package Details
- Repository
- Cloudflare pulumi/pulumi-cloudflare
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cloudflare
Terraform Provider.