1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getUserAgentBlockingRule
Cloudflare v6.6.0 published on Wednesday, Aug 20, 2025 by Pulumi

cloudflare.getUserAgentBlockingRule

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.6.0 published on Wednesday, Aug 20, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleUserAgentBlockingRule = cloudflare.getUserAgentBlockingRule({
        zoneId: "023e105f4ecef8ad9ca31a8372d0c353",
        uaRuleId: "372e67954025e0ba6aaa6d586b9e0b59",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_user_agent_blocking_rule = cloudflare.get_user_agent_blocking_rule(zone_id="023e105f4ecef8ad9ca31a8372d0c353",
        ua_rule_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.LookupUserAgentBlockingRule(ctx, &cloudflare.LookupUserAgentBlockingRuleArgs{
    			ZoneId:   "023e105f4ecef8ad9ca31a8372d0c353",
    			UaRuleId: 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 exampleUserAgentBlockingRule = Cloudflare.GetUserAgentBlockingRule.Invoke(new()
        {
            ZoneId = "023e105f4ecef8ad9ca31a8372d0c353",
            UaRuleId = "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.GetUserAgentBlockingRuleArgs;
    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 exampleUserAgentBlockingRule = CloudflareFunctions.getUserAgentBlockingRule(GetUserAgentBlockingRuleArgs.builder()
                .zoneId("023e105f4ecef8ad9ca31a8372d0c353")
                .uaRuleId("372e67954025e0ba6aaa6d586b9e0b59")
                .build());
    
        }
    }
    
    variables:
      exampleUserAgentBlockingRule:
        fn::invoke:
          function: cloudflare:getUserAgentBlockingRule
          arguments:
            zoneId: 023e105f4ecef8ad9ca31a8372d0c353
            uaRuleId: 372e67954025e0ba6aaa6d586b9e0b59
    

    Using getUserAgentBlockingRule

    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 getUserAgentBlockingRule(args: GetUserAgentBlockingRuleArgs, opts?: InvokeOptions): Promise<GetUserAgentBlockingRuleResult>
    function getUserAgentBlockingRuleOutput(args: GetUserAgentBlockingRuleOutputArgs, opts?: InvokeOptions): Output<GetUserAgentBlockingRuleResult>
    def get_user_agent_blocking_rule(filter: Optional[GetUserAgentBlockingRuleFilter] = None,
                                     ua_rule_id: Optional[str] = None,
                                     zone_id: Optional[str] = None,
                                     opts: Optional[InvokeOptions] = None) -> GetUserAgentBlockingRuleResult
    def get_user_agent_blocking_rule_output(filter: Optional[pulumi.Input[GetUserAgentBlockingRuleFilterArgs]] = None,
                                     ua_rule_id: Optional[pulumi.Input[str]] = None,
                                     zone_id: Optional[pulumi.Input[str]] = None,
                                     opts: Optional[InvokeOptions] = None) -> Output[GetUserAgentBlockingRuleResult]
    func LookupUserAgentBlockingRule(ctx *Context, args *LookupUserAgentBlockingRuleArgs, opts ...InvokeOption) (*LookupUserAgentBlockingRuleResult, error)
    func LookupUserAgentBlockingRuleOutput(ctx *Context, args *LookupUserAgentBlockingRuleOutputArgs, opts ...InvokeOption) LookupUserAgentBlockingRuleResultOutput

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

    public static class GetUserAgentBlockingRule 
    {
        public static Task<GetUserAgentBlockingRuleResult> InvokeAsync(GetUserAgentBlockingRuleArgs args, InvokeOptions? opts = null)
        public static Output<GetUserAgentBlockingRuleResult> Invoke(GetUserAgentBlockingRuleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetUserAgentBlockingRuleResult> getUserAgentBlockingRule(GetUserAgentBlockingRuleArgs args, InvokeOptions options)
    public static Output<GetUserAgentBlockingRuleResult> getUserAgentBlockingRule(GetUserAgentBlockingRuleArgs args, InvokeOptions options)
    
    fn::invoke:
      function: cloudflare:index/getUserAgentBlockingRule:getUserAgentBlockingRule
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ZoneId string
    Defines an identifier.
    Filter GetUserAgentBlockingRuleFilter
    UaRuleId string
    The unique identifier of the User Agent Blocking rule.
    ZoneId string
    Defines an identifier.
    Filter GetUserAgentBlockingRuleFilter
    UaRuleId string
    The unique identifier of the User Agent Blocking rule.
    zoneId String
    Defines an identifier.
    filter GetUserAgentBlockingRuleFilter
    uaRuleId String
    The unique identifier of the User Agent Blocking rule.
    zoneId string
    Defines an identifier.
    filter GetUserAgentBlockingRuleFilter
    uaRuleId string
    The unique identifier of the User Agent Blocking rule.
    zone_id str
    Defines an identifier.
    filter GetUserAgentBlockingRuleFilter
    ua_rule_id str
    The unique identifier of the User Agent Blocking rule.
    zoneId String
    Defines an identifier.
    filter Property Map
    uaRuleId String
    The unique identifier of the User Agent Blocking rule.

    getUserAgentBlockingRule Result

    The following output properties are available:

    Configuration GetUserAgentBlockingRuleConfiguration
    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.
    ZoneId string
    Defines an identifier.
    Filter GetUserAgentBlockingRuleFilter
    UaRuleId string
    The unique identifier of the User Agent Blocking rule.
    Configuration GetUserAgentBlockingRuleConfiguration
    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.
    ZoneId string
    Defines an identifier.
    Filter GetUserAgentBlockingRuleFilter
    UaRuleId string
    The unique identifier of the User Agent Blocking rule.
    configuration GetUserAgentBlockingRuleConfiguration
    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.
    zoneId String
    Defines an identifier.
    filter GetUserAgentBlockingRuleFilter
    uaRuleId String
    The unique identifier of the User Agent Blocking rule.
    configuration GetUserAgentBlockingRuleConfiguration
    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.
    zoneId string
    Defines an identifier.
    filter GetUserAgentBlockingRuleFilter
    uaRuleId string
    The unique identifier of the User Agent Blocking rule.
    configuration GetUserAgentBlockingRuleConfiguration
    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.
    zone_id str
    Defines an identifier.
    filter GetUserAgentBlockingRuleFilter
    ua_rule_id str
    The unique identifier of the User Agent Blocking rule.
    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.
    zoneId String
    Defines an identifier.
    filter Property Map
    uaRuleId String
    The unique identifier of the User Agent Blocking rule.

    Supporting Types

    GetUserAgentBlockingRuleConfiguration

    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.

    GetUserAgentBlockingRuleFilter

    Description string
    A string to search for in the description of existing rules.
    Paused bool
    When true, indicates that the rule is currently paused.
    UserAgent string
    A string to search for in the user agent values of existing rules.
    Description string
    A string to search for in the description of existing rules.
    Paused bool
    When true, indicates that the rule is currently paused.
    UserAgent string
    A string to search for in the user agent values of existing rules.
    description String
    A string to search for in the description of existing rules.
    paused Boolean
    When true, indicates that the rule is currently paused.
    userAgent String
    A string to search for in the user agent values of existing rules.
    description string
    A string to search for in the description of existing rules.
    paused boolean
    When true, indicates that the rule is currently paused.
    userAgent string
    A string to search for in the user agent values of existing rules.
    description str
    A string to search for in the description of existing rules.
    paused bool
    When true, indicates that the rule is currently paused.
    user_agent str
    A string to search for in the user agent values of existing rules.
    description String
    A string to search for in the description of existing rules.
    paused Boolean
    When true, indicates that the rule is currently paused.
    userAgent String
    A string to search for in the user agent values of existing rules.

    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.6.0 published on Wednesday, Aug 20, 2025 by Pulumi