1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getUserAgentBlockingRules
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

cloudflare.getUserAgentBlockingRules

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleUserAgentBlockingRules = cloudflare.getUserAgentBlockingRules({
        zoneId: "023e105f4ecef8ad9ca31a8372d0c353",
        description: "abusive",
        descriptionSearch: "abusive",
        uaSearch: "Safari",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_user_agent_blocking_rules = cloudflare.get_user_agent_blocking_rules(zone_id="023e105f4ecef8ad9ca31a8372d0c353",
        description="abusive",
        description_search="abusive",
        ua_search="Safari")
    
    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.LookupUserAgentBlockingRules(ctx, &cloudflare.LookupUserAgentBlockingRulesArgs{
    			ZoneId:            "023e105f4ecef8ad9ca31a8372d0c353",
    			Description:       pulumi.StringRef("abusive"),
    			DescriptionSearch: pulumi.StringRef("abusive"),
    			UaSearch:          pulumi.StringRef("Safari"),
    		}, 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 exampleUserAgentBlockingRules = Cloudflare.GetUserAgentBlockingRules.Invoke(new()
        {
            ZoneId = "023e105f4ecef8ad9ca31a8372d0c353",
            Description = "abusive",
            DescriptionSearch = "abusive",
            UaSearch = "Safari",
        });
    
    });
    
    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.GetUserAgentBlockingRulesArgs;
    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 exampleUserAgentBlockingRules = CloudflareFunctions.getUserAgentBlockingRules(GetUserAgentBlockingRulesArgs.builder()
                .zoneId("023e105f4ecef8ad9ca31a8372d0c353")
                .description("abusive")
                .descriptionSearch("abusive")
                .uaSearch("Safari")
                .build());
    
        }
    }
    
    variables:
      exampleUserAgentBlockingRules:
        fn::invoke:
          function: cloudflare:getUserAgentBlockingRules
          arguments:
            zoneId: 023e105f4ecef8ad9ca31a8372d0c353
            description: abusive
            descriptionSearch: abusive
            uaSearch: Safari
    

    Using getUserAgentBlockingRules

    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 getUserAgentBlockingRules(args: GetUserAgentBlockingRulesArgs, opts?: InvokeOptions): Promise<GetUserAgentBlockingRulesResult>
    function getUserAgentBlockingRulesOutput(args: GetUserAgentBlockingRulesOutputArgs, opts?: InvokeOptions): Output<GetUserAgentBlockingRulesResult>
    def get_user_agent_blocking_rules(description: Optional[str] = None,
                                      description_search: Optional[str] = None,
                                      max_items: Optional[int] = None,
                                      ua_search: Optional[str] = None,
                                      zone_id: Optional[str] = None,
                                      opts: Optional[InvokeOptions] = None) -> GetUserAgentBlockingRulesResult
    def get_user_agent_blocking_rules_output(description: Optional[pulumi.Input[str]] = None,
                                      description_search: Optional[pulumi.Input[str]] = None,
                                      max_items: Optional[pulumi.Input[int]] = None,
                                      ua_search: Optional[pulumi.Input[str]] = None,
                                      zone_id: Optional[pulumi.Input[str]] = None,
                                      opts: Optional[InvokeOptions] = None) -> Output[GetUserAgentBlockingRulesResult]
    func LookupUserAgentBlockingRules(ctx *Context, args *LookupUserAgentBlockingRulesArgs, opts ...InvokeOption) (*LookupUserAgentBlockingRulesResult, error)
    func LookupUserAgentBlockingRulesOutput(ctx *Context, args *LookupUserAgentBlockingRulesOutputArgs, opts ...InvokeOption) LookupUserAgentBlockingRulesResultOutput

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

    public static class GetUserAgentBlockingRules 
    {
        public static Task<GetUserAgentBlockingRulesResult> InvokeAsync(GetUserAgentBlockingRulesArgs args, InvokeOptions? opts = null)
        public static Output<GetUserAgentBlockingRulesResult> Invoke(GetUserAgentBlockingRulesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetUserAgentBlockingRulesResult> getUserAgentBlockingRules(GetUserAgentBlockingRulesArgs args, InvokeOptions options)
    public static Output<GetUserAgentBlockingRulesResult> getUserAgentBlockingRules(GetUserAgentBlockingRulesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: cloudflare:index/getUserAgentBlockingRules:getUserAgentBlockingRules
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ZoneId string
    Identifier
    Description string
    A string to search for in the description of existing rules.
    DescriptionSearch string
    A string to search for in the description of existing rules.
    MaxItems int
    Max items to fetch, default: 1000
    UaSearch string
    A string to search for in the user agent values of existing rules.
    ZoneId string
    Identifier
    Description string
    A string to search for in the description of existing rules.
    DescriptionSearch string
    A string to search for in the description of existing rules.
    MaxItems int
    Max items to fetch, default: 1000
    UaSearch string
    A string to search for in the user agent values of existing rules.
    zoneId String
    Identifier
    description String
    A string to search for in the description of existing rules.
    descriptionSearch String
    A string to search for in the description of existing rules.
    maxItems Integer
    Max items to fetch, default: 1000
    uaSearch String
    A string to search for in the user agent values of existing rules.
    zoneId string
    Identifier
    description string
    A string to search for in the description of existing rules.
    descriptionSearch string
    A string to search for in the description of existing rules.
    maxItems number
    Max items to fetch, default: 1000
    uaSearch string
    A string to search for in the user agent values of existing rules.
    zone_id str
    Identifier
    description str
    A string to search for in the description of existing rules.
    description_search str
    A string to search for in the description of existing rules.
    max_items int
    Max items to fetch, default: 1000
    ua_search str
    A string to search for in the user agent values of existing rules.
    zoneId String
    Identifier
    description String
    A string to search for in the description of existing rules.
    descriptionSearch String
    A string to search for in the description of existing rules.
    maxItems Number
    Max items to fetch, default: 1000
    uaSearch String
    A string to search for in the user agent values of existing rules.

    getUserAgentBlockingRules Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Results List<GetUserAgentBlockingRulesResult>
    The items returned by the data source
    ZoneId string
    Identifier
    Description string
    A string to search for in the description of existing rules.
    DescriptionSearch string
    A string to search for in the description of existing rules.
    MaxItems int
    Max items to fetch, default: 1000
    UaSearch string
    A string to search for in the user agent values of existing rules.
    Id string
    The provider-assigned unique ID for this managed resource.
    Results []GetUserAgentBlockingRulesResult
    The items returned by the data source
    ZoneId string
    Identifier
    Description string
    A string to search for in the description of existing rules.
    DescriptionSearch string
    A string to search for in the description of existing rules.
    MaxItems int
    Max items to fetch, default: 1000
    UaSearch string
    A string to search for in the user agent values of existing rules.
    id String
    The provider-assigned unique ID for this managed resource.
    results List<GetUserAgentBlockingRulesResult>
    The items returned by the data source
    zoneId String
    Identifier
    description String
    A string to search for in the description of existing rules.
    descriptionSearch String
    A string to search for in the description of existing rules.
    maxItems Integer
    Max items to fetch, default: 1000
    uaSearch String
    A string to search for in the user agent values of existing rules.
    id string
    The provider-assigned unique ID for this managed resource.
    results GetUserAgentBlockingRulesResult[]
    The items returned by the data source
    zoneId string
    Identifier
    description string
    A string to search for in the description of existing rules.
    descriptionSearch string
    A string to search for in the description of existing rules.
    maxItems number
    Max items to fetch, default: 1000
    uaSearch string
    A string to search for in the user agent values of existing rules.
    id str
    The provider-assigned unique ID for this managed resource.
    results Sequence[GetUserAgentBlockingRulesResult]
    The items returned by the data source
    zone_id str
    Identifier
    description str
    A string to search for in the description of existing rules.
    description_search str
    A string to search for in the description of existing rules.
    max_items int
    Max items to fetch, default: 1000
    ua_search str
    A string to search for in the user agent values of existing rules.
    id String
    The provider-assigned unique ID for this managed resource.
    results List<Property Map>
    The items returned by the data source
    zoneId String
    Identifier
    description String
    A string to search for in the description of existing rules.
    descriptionSearch String
    A string to search for in the description of existing rules.
    maxItems Number
    Max items to fetch, default: 1000
    uaSearch String
    A string to search for in the user agent values of existing rules.

    Supporting Types

    GetUserAgentBlockingRulesResult

    Configuration GetUserAgentBlockingRulesResultConfiguration
    The configuration object for the current rule.
    Description string
    An informative summary of the rule.
    Id string
    The unique identifier of the User Agent Blocking rule.
    Mode string
    The action to apply to a matched request. Available values: "block", "challenge", "jschallenge", "managedchallenge".
    Paused bool
    When true, indicates that the rule is currently paused.
    Configuration GetUserAgentBlockingRulesResultConfiguration
    The configuration object for the current rule.
    Description string
    An informative summary of the rule.
    Id string
    The unique identifier of the User Agent Blocking rule.
    Mode string
    The action to apply to a matched request. Available values: "block", "challenge", "jschallenge", "managedchallenge".
    Paused bool
    When true, indicates that the rule is currently paused.
    configuration GetUserAgentBlockingRulesResultConfiguration
    The configuration object for the current rule.
    description String
    An informative summary of the rule.
    id String
    The unique identifier of the User Agent Blocking rule.
    mode String
    The action to apply to a matched request. Available values: "block", "challenge", "jschallenge", "managedchallenge".
    paused Boolean
    When true, indicates that the rule is currently paused.
    configuration GetUserAgentBlockingRulesResultConfiguration
    The configuration object for the current rule.
    description string
    An informative summary of the rule.
    id string
    The unique identifier of the User Agent Blocking rule.
    mode string
    The action to apply to a matched request. Available values: "block", "challenge", "jschallenge", "managedchallenge".
    paused boolean
    When true, indicates that the rule is currently paused.
    configuration GetUserAgentBlockingRulesResultConfiguration
    The configuration object for the current rule.
    description str
    An informative summary of the rule.
    id str
    The unique identifier of the User Agent Blocking rule.
    mode str
    The action to apply to a matched request. Available values: "block", "challenge", "jschallenge", "managedchallenge".
    paused bool
    When true, indicates that the rule is currently paused.
    configuration Property Map
    The configuration object for the current rule.
    description String
    An informative summary of the rule.
    id String
    The unique identifier of the User Agent Blocking rule.
    mode String
    The action to apply to a matched request. Available values: "block", "challenge", "jschallenge", "managedchallenge".
    paused Boolean
    When true, indicates that the rule is currently paused.

    GetUserAgentBlockingRulesResultConfiguration

    Target string
    The configuration target for this rule. You must set the target to ua for User Agent Blocking rules.
    Value string
    The exact user agent string to match. This value will be compared to the received User-Agent HTTP header value.
    Target string
    The configuration target for this rule. You must set the target to ua for User Agent Blocking rules.
    Value string
    The exact user agent string to match. This value will be compared to the received User-Agent HTTP header value.
    target String
    The configuration target for this rule. You must set the target to ua for User Agent Blocking rules.
    value String
    The exact user agent string to match. This value will be compared to the received User-Agent HTTP header value.
    target string
    The configuration target for this rule. You must set the target to ua for User Agent Blocking rules.
    value string
    The exact user agent string to match. This value will be compared to the received User-Agent HTTP header value.
    target str
    The configuration target for this rule. You must set the target to ua for User Agent Blocking rules.
    value str
    The exact user agent string to match. This value will be compared to the received User-Agent HTTP header value.
    target String
    The configuration target for this rule. You must set the target to ua for User Agent Blocking rules.
    value String
    The exact user agent string to match. This value will be compared to the received User-Agent HTTP header value.

    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.2 published on Monday, Apr 28, 2025 by Pulumi