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

cloudflare.getUserAgentBlockingRules

Explore with Pulumi AI

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",
});
Copy
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")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  exampleUserAgentBlockingRules:
    fn::invoke:
      function: cloudflare:getUserAgentBlockingRules
      arguments:
        zoneId: 023e105f4ecef8ad9ca31a8372d0c353
        description: abusive
        descriptionSearch: abusive
        uaSearch: Safari
Copy

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>
Copy
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]
Copy
func LookupUserAgentBlockingRules(ctx *Context, args *LookupUserAgentBlockingRulesArgs, opts ...InvokeOption) (*LookupUserAgentBlockingRulesResult, error)
func LookupUserAgentBlockingRulesOutput(ctx *Context, args *LookupUserAgentBlockingRulesOutputArgs, opts ...InvokeOption) LookupUserAgentBlockingRulesResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetUserAgentBlockingRulesResult> getUserAgentBlockingRules(GetUserAgentBlockingRulesArgs args, InvokeOptions options)
public static Output<GetUserAgentBlockingRulesResult> getUserAgentBlockingRules(GetUserAgentBlockingRulesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: cloudflare:index/getUserAgentBlockingRules:getUserAgentBlockingRules
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

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

GetUserAgentBlockingRulesResultConfiguration

Target This property is required. string
The configuration target for this rule. You must set the target to ua for User Agent Blocking rules.
Value This property is required. string
The exact user agent string to match. This value will be compared to the received User-Agent HTTP header value.
Target This property is required. string
The configuration target for this rule. You must set the target to ua for User Agent Blocking rules.
Value This property is required. string
The exact user agent string to match. This value will be compared to the received User-Agent HTTP header value.
target This property is required. String
The configuration target for this rule. You must set the target to ua for User Agent Blocking rules.
value This property is required. String
The exact user agent string to match. This value will be compared to the received User-Agent HTTP header value.
target This property is required. string
The configuration target for this rule. You must set the target to ua for User Agent Blocking rules.
value This property is required. string
The exact user agent string to match. This value will be compared to the received User-Agent HTTP header value.
target This property is required. str
The configuration target for this rule. You must set the target to ua for User Agent Blocking rules.
value This property is required. str
The exact user agent string to match. This value will be compared to the received User-Agent HTTP header value.
target This property is required. String
The configuration target for this rule. You must set the target to ua for User Agent Blocking rules.
value This property is required. 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.