FilterArgs

data class FilterArgs(val description: Output<String>? = null, val expression: Output<String>? = null, val paused: Output<Boolean>? = null, val ref: Output<String>? = null, val zoneId: Output<String>? = null) : ConvertibleToJava<FilterArgs>

Filter expressions that can be referenced across multiple features, e.g. Firewall Rules. See what is a filter for more details and available fields and operators.

cloudflare.Filter is in a deprecation phase until June 15th, 2025. During this time period, this resource is still fully supported but you are strongly advised to move to the cloudflare.Ruleset resource. Full details can be found in the developer documentation.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const wordpress = new cloudflare.Filter("wordpress", {
zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
description: "Wordpress break-in attempts that are outside of the office",
expression: "(http.request.uri.path ~ \".*wp-login.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.src ne 192.0.2.1",
});
import pulumi
import pulumi_cloudflare as cloudflare
wordpress = cloudflare.Filter("wordpress",
zone_id="0da42c8d2132a9ddaf714f9e7c920711",
description="Wordpress break-in attempts that are outside of the office",
expression="(http.request.uri.path ~ \".*wp-login.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.src ne 192.0.2.1")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
var wordpress = new Cloudflare.Filter("wordpress", new()
{
ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
Description = "Wordpress break-in attempts that are outside of the office",
Expression = "(http.request.uri.path ~ \".*wp-login.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.src ne 192.0.2.1",
});
});
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.NewFilter(ctx, "wordpress", &cloudflare.FilterArgs{
ZoneId: pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
Description: pulumi.String("Wordpress break-in attempts that are outside of the office"),
Expression: pulumi.String("(http.request.uri.path ~ \".*wp-login.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.src ne 192.0.2.1"),
})
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.Filter;
import com.pulumi.cloudflare.FilterArgs;
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 wordpress = new Filter("wordpress", FilterArgs.builder()
.zoneId("0da42c8d2132a9ddaf714f9e7c920711")
.description("Wordpress break-in attempts that are outside of the office")
.expression("(http.request.uri.path ~ \".*wp-login.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.src ne 192.0.2.1")
.build());
}
}
resources:
wordpress:
type: cloudflare:Filter
properties:
zoneId: 0da42c8d2132a9ddaf714f9e7c920711
description: Wordpress break-in attempts that are outside of the office
expression: (http.request.uri.path ~ ".*wp-login.php" or http.request.uri.path ~ ".*xmlrpc.php") and ip.src ne 192.0.2.1

Import

$ pulumi import cloudflare:index/filter:Filter example <zone_id>/<filter_id>

Constructors

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

Properties

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

A note that you can use to describe the purpose of the filter.

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

The filter expression to be used.

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

Whether this filter is currently paused.

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

Short reference tag to quickly select related rules.

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(): FilterArgs