1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getRateLimit
Cloudflare v6.1.1 published on Monday, Apr 21, 2025 by Pulumi

cloudflare.getRateLimit

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.1.1 published on Monday, Apr 21, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleRateLimit = cloudflare.getRateLimit({
        zoneId: "023e105f4ecef8ad9ca31a8372d0c353",
        rateLimitId: "372e67954025e0ba6aaa6d586b9e0b59",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_rate_limit = cloudflare.get_rate_limit(zone_id="023e105f4ecef8ad9ca31a8372d0c353",
        rate_limit_id="372e67954025e0ba6aaa6d586b9e0b59")
    
    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.LookupRateLimit(ctx, &cloudflare.LookupRateLimitArgs{
    			ZoneId:      "023e105f4ecef8ad9ca31a8372d0c353",
    			RateLimitId: pulumi.StringRef("372e67954025e0ba6aaa6d586b9e0b59"),
    		}, 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 exampleRateLimit = Cloudflare.GetRateLimit.Invoke(new()
        {
            ZoneId = "023e105f4ecef8ad9ca31a8372d0c353",
            RateLimitId = "372e67954025e0ba6aaa6d586b9e0b59",
        });
    
    });
    
    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.GetRateLimitArgs;
    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 exampleRateLimit = CloudflareFunctions.getRateLimit(GetRateLimitArgs.builder()
                .zoneId("023e105f4ecef8ad9ca31a8372d0c353")
                .rateLimitId("372e67954025e0ba6aaa6d586b9e0b59")
                .build());
    
        }
    }
    
    variables:
      exampleRateLimit:
        fn::invoke:
          function: cloudflare:getRateLimit
          arguments:
            zoneId: 023e105f4ecef8ad9ca31a8372d0c353
            rateLimitId: 372e67954025e0ba6aaa6d586b9e0b59
    

    Using getRateLimit

    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 getRateLimit(args: GetRateLimitArgs, opts?: InvokeOptions): Promise<GetRateLimitResult>
    function getRateLimitOutput(args: GetRateLimitOutputArgs, opts?: InvokeOptions): Output<GetRateLimitResult>
    def get_rate_limit(rate_limit_id: Optional[str] = None,
                       zone_id: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetRateLimitResult
    def get_rate_limit_output(rate_limit_id: Optional[pulumi.Input[str]] = None,
                       zone_id: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetRateLimitResult]
    func LookupRateLimit(ctx *Context, args *LookupRateLimitArgs, opts ...InvokeOption) (*LookupRateLimitResult, error)
    func LookupRateLimitOutput(ctx *Context, args *LookupRateLimitOutputArgs, opts ...InvokeOption) LookupRateLimitResultOutput

    > Note: This function is named LookupRateLimit in the Go SDK.

    public static class GetRateLimit 
    {
        public static Task<GetRateLimitResult> InvokeAsync(GetRateLimitArgs args, InvokeOptions? opts = null)
        public static Output<GetRateLimitResult> Invoke(GetRateLimitInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRateLimitResult> getRateLimit(GetRateLimitArgs args, InvokeOptions options)
    public static Output<GetRateLimitResult> getRateLimit(GetRateLimitArgs args, InvokeOptions options)
    
    fn::invoke:
      function: cloudflare:index/getRateLimit:getRateLimit
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ZoneId string
    Identifier
    RateLimitId string
    The unique identifier of the rate limit.
    ZoneId string
    Identifier
    RateLimitId string
    The unique identifier of the rate limit.
    zoneId String
    Identifier
    rateLimitId String
    The unique identifier of the rate limit.
    zoneId string
    Identifier
    rateLimitId string
    The unique identifier of the rate limit.
    zone_id str
    Identifier
    rate_limit_id str
    The unique identifier of the rate limit.
    zoneId String
    Identifier
    rateLimitId String
    The unique identifier of the rate limit.

    getRateLimit Result

    The following output properties are available:

    Action GetRateLimitAction
    The action to perform when the threshold of matched traffic within the configured period is exceeded.
    Bypasses List<GetRateLimitBypass>
    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 GetRateLimitMatch
    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.
    ZoneId string
    Identifier
    RateLimitId string
    The unique identifier of the rate limit.
    Action GetRateLimitAction
    The action to perform when the threshold of matched traffic within the configured period is exceeded.
    Bypasses []GetRateLimitBypass
    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 GetRateLimitMatch
    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.
    ZoneId string
    Identifier
    RateLimitId string
    The unique identifier of the rate limit.
    action GetRateLimitAction
    The action to perform when the threshold of matched traffic within the configured period is exceeded.
    bypasses List<GetRateLimitBypass>
    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 GetRateLimitMatch
    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.
    zoneId String
    Identifier
    rateLimitId String
    The unique identifier of the rate limit.
    action GetRateLimitAction
    The action to perform when the threshold of matched traffic within the configured period is exceeded.
    bypasses GetRateLimitBypass[]
    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 GetRateLimitMatch
    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.
    zoneId string
    Identifier
    rateLimitId string
    The unique identifier of the rate limit.
    action GetRateLimitAction
    The action to perform when the threshold of matched traffic within the configured period is exceeded.
    bypasses Sequence[GetRateLimitBypass]
    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 GetRateLimitMatch
    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.
    zone_id str
    Identifier
    rate_limit_id str
    The unique identifier of the rate limit.
    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.
    zoneId String
    Identifier
    rateLimitId String
    The unique identifier of the rate limit.

    Supporting Types

    GetRateLimitAction

    Mode string
    The action to perform. Available values: "simulate", "ban", "challenge", "jschallenge", "managedchallenge".
    Response GetRateLimitActionResponse
    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 GetRateLimitActionResponse
    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 GetRateLimitActionResponse
    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 GetRateLimitActionResponse
    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 GetRateLimitActionResponse
    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.

    GetRateLimitActionResponse

    Body string
    The response body to return. The value must conform to the configured content type.
    ContentType string
    The content type of the body. Must be one of the following: text/plain, text/xml, or application/json.
    Body string
    The response body to return. The value must conform to the configured content type.
    ContentType string
    The content type of the body. Must be one of the following: text/plain, text/xml, or application/json.
    body String
    The response body to return. The value must conform to the configured content type.
    contentType String
    The content type of the body. Must be one of the following: text/plain, text/xml, or application/json.
    body string
    The response body to return. The value must conform to the configured content type.
    contentType string
    The content type of the body. Must be one of the following: text/plain, text/xml, or application/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, or application/json.
    body String
    The response body to return. The value must conform to the configured content type.
    contentType String
    The content type of the body. Must be one of the following: text/plain, text/xml, or application/json.

    GetRateLimitBypass

    Name string
    Available values: "url".
    Value string
    The URL to bypass.
    Name string
    Available values: "url".
    Value string
    The URL to bypass.
    name String
    Available values: "url".
    value String
    The URL to bypass.
    name string
    Available values: "url".
    value string
    The URL to bypass.
    name str
    Available values: "url".
    value str
    The URL to bypass.
    name String
    Available values: "url".
    value String
    The URL to bypass.

    GetRateLimitMatch

    GetRateLimitMatchHeader

    Name string
    The name of the response header to match.
    Op string
    The operator used when matching: eq means "equal" and ne means "not equal". Available values: "eq", "ne".
    Value string
    The value of the response header, which must match exactly.
    Name string
    The name of the response header to match.
    Op string
    The operator used when matching: eq means "equal" and ne means "not equal". Available values: "eq", "ne".
    Value string
    The value of the response header, which must match exactly.
    name String
    The name of the response header to match.
    op String
    The operator used when matching: eq means "equal" and ne means "not equal". Available values: "eq", "ne".
    value String
    The value of the response header, which must match exactly.
    name string
    The name of the response header to match.
    op string
    The operator used when matching: eq means "equal" and ne means "not equal". Available values: "eq", "ne".
    value string
    The value of the response header, which must match exactly.
    name str
    The name of the response header to match.
    op str
    The operator used when matching: eq means "equal" and ne means "not equal". Available values: "eq", "ne".
    value str
    The value of the response header, which must match exactly.
    name String
    The name of the response header to match.
    op String
    The operator used when matching: eq means "equal" and ne means "not equal". Available values: "eq", "ne".
    value String
    The value of the response header, which must match exactly.

    GetRateLimitMatchRequest

    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.

    GetRateLimitMatchResponse

    OriginTraffic 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.
    OriginTraffic 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.
    originTraffic 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.
    originTraffic 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.
    originTraffic 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.
    cloudflare logo
    Cloudflare v6.1.1 published on Monday, Apr 21, 2025 by Pulumi