UserAgentBlockingRuleArgs

data class UserAgentBlockingRuleArgs(val configuration: Output<UserAgentBlockingRuleConfigurationArgs>? = null, val description: Output<String>? = null, val mode: Output<String>? = null, val paused: Output<Boolean>? = null, val zoneId: Output<String>? = null) : ConvertibleToJava<UserAgentBlockingRuleArgs>

Provides a resource to manage User Agent Blocking Rules.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const example1 = new cloudflare.UserAgentBlockingRule("example_1", {
zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
mode: "js_challenge",
paused: false,
description: "My description 1",
configuration: {
target: "ua",
value: "Chrome",
},
});
const example2 = new cloudflare.UserAgentBlockingRule("example_2", {
zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
mode: "challenge",
paused: true,
description: "My description 22",
configuration: {
target: "ua",
value: "Mozilla",
},
});
import pulumi
import pulumi_cloudflare as cloudflare
example1 = cloudflare.UserAgentBlockingRule("example_1",
zone_id="0da42c8d2132a9ddaf714f9e7c920711",
mode="js_challenge",
paused=False,
description="My description 1",
configuration={
"target": "ua",
"value": "Chrome",
})
example2 = cloudflare.UserAgentBlockingRule("example_2",
zone_id="0da42c8d2132a9ddaf714f9e7c920711",
mode="challenge",
paused=True,
description="My description 22",
configuration={
"target": "ua",
"value": "Mozilla",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
var example1 = new Cloudflare.UserAgentBlockingRule("example_1", new()
{
ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
Mode = "js_challenge",
Paused = false,
Description = "My description 1",
Configuration = new Cloudflare.Inputs.UserAgentBlockingRuleConfigurationArgs
{
Target = "ua",
Value = "Chrome",
},
});
var example2 = new Cloudflare.UserAgentBlockingRule("example_2", new()
{
ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
Mode = "challenge",
Paused = true,
Description = "My description 22",
Configuration = new Cloudflare.Inputs.UserAgentBlockingRuleConfigurationArgs
{
Target = "ua",
Value = "Mozilla",
},
});
});
package main
import (
"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloudflare.NewUserAgentBlockingRule(ctx, "example_1", &cloudflare.UserAgentBlockingRuleArgs{
ZoneId: pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
Mode: pulumi.String("js_challenge"),
Paused: pulumi.Bool(false),
Description: pulumi.String("My description 1"),
Configuration: &cloudflare.UserAgentBlockingRuleConfigurationArgs{
Target: pulumi.String("ua"),
Value: pulumi.String("Chrome"),
},
})
if err != nil {
return err
}
_, err = cloudflare.NewUserAgentBlockingRule(ctx, "example_2", &cloudflare.UserAgentBlockingRuleArgs{
ZoneId: pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
Mode: pulumi.String("challenge"),
Paused: pulumi.Bool(true),
Description: pulumi.String("My description 22"),
Configuration: &cloudflare.UserAgentBlockingRuleConfigurationArgs{
Target: pulumi.String("ua"),
Value: pulumi.String("Mozilla"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.UserAgentBlockingRule;
import com.pulumi.cloudflare.UserAgentBlockingRuleArgs;
import com.pulumi.cloudflare.inputs.UserAgentBlockingRuleConfigurationArgs;
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) {
var example1 = new UserAgentBlockingRule("example1", UserAgentBlockingRuleArgs.builder()
.zoneId("0da42c8d2132a9ddaf714f9e7c920711")
.mode("js_challenge")
.paused(false)
.description("My description 1")
.configuration(UserAgentBlockingRuleConfigurationArgs.builder()
.target("ua")
.value("Chrome")
.build())
.build());
var example2 = new UserAgentBlockingRule("example2", UserAgentBlockingRuleArgs.builder()
.zoneId("0da42c8d2132a9ddaf714f9e7c920711")
.mode("challenge")
.paused(true)
.description("My description 22")
.configuration(UserAgentBlockingRuleConfigurationArgs.builder()
.target("ua")
.value("Mozilla")
.build())
.build());
}
}
resources:
example1:
type: cloudflare:UserAgentBlockingRule
name: example_1
properties:
zoneId: 0da42c8d2132a9ddaf714f9e7c920711
mode: js_challenge
paused: false
description: My description 1
configuration:
target: ua
value: Chrome
example2:
type: cloudflare:UserAgentBlockingRule
name: example_2
properties:
zoneId: 0da42c8d2132a9ddaf714f9e7c920711
mode: challenge
paused: true
description: My description 22
configuration:
target: ua
value: Mozilla

Import

$ pulumi import cloudflare:index/userAgentBlockingRule:UserAgentBlockingRule example <zone_id>/<user_agent_blocking_rule_id>

Constructors

Link copied to clipboard
constructor(configuration: Output<UserAgentBlockingRuleConfigurationArgs>? = null, description: Output<String>? = null, mode: Output<String>? = null, paused: Output<Boolean>? = null, zoneId: Output<String>? = null)

Properties

Link copied to clipboard

The configuration object for the current rule.

Link copied to clipboard
val description: Output<String>? = null

An informative summary of the rule.

Link copied to clipboard
val mode: Output<String>? = null

The action to apply to a matched request. Available values: block, challenge, js_challenge, managed_challenge.

Link copied to clipboard
val paused: Output<Boolean>? = null

When true, indicates that the rule is currently paused.

Link copied to clipboard
val zoneId: Output<String>? = null

The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.

Functions

Link copied to clipboard
open override fun toJava(): UserAgentBlockingRuleArgs