Filter

class Filter : KotlinCustomResource

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 exampleFilter = new cloudflare.Filter("example_filter", {
zoneId: "023e105f4ecef8ad9ca31a8372d0c353",
expression: "(http.request.uri.path ~ \".*wp-login.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.addr ne 172.16.22.155",
});
import pulumi
import pulumi_cloudflare as cloudflare
example_filter = cloudflare.Filter("example_filter",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
expression="(http.request.uri.path ~ \".*wp-login.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.addr ne 172.16.22.155")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
var exampleFilter = new Cloudflare.Filter("example_filter", new()
{
ZoneId = "023e105f4ecef8ad9ca31a8372d0c353",
Expression = "(http.request.uri.path ~ \".*wp-login.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.addr ne 172.16.22.155",
});
});
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.NewFilter(ctx, "example_filter", &cloudflare.FilterArgs{
ZoneId: pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
Expression: pulumi.String("(http.request.uri.path ~ \".*wp-login.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.addr ne 172.16.22.155"),
})
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 exampleFilter = new Filter("exampleFilter", FilterArgs.builder()
.zoneId("023e105f4ecef8ad9ca31a8372d0c353")
.expression("(http.request.uri.path ~ \".*wp-login.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.addr ne 172.16.22.155")
.build());
}
}
resources:
exampleFilter:
type: cloudflare:Filter
name: example_filter
properties:
zoneId: 023e105f4ecef8ad9ca31a8372d0c353
expression: (http.request.uri.path ~ ".*wp-login.php" or http.request.uri.path ~ ".*xmlrpc.php") and ip.addr ne 172.16.22.155

Import

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

Properties

Link copied to clipboard
val description: Output<String>

An informative summary of the filter.

Link copied to clipboard
val expression: Output<String>

The filter expression. For more information, refer to Expressions.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val paused: Output<Boolean>

When true, indicates that the filter is currently paused.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val ref: Output<String>

A short reference tag. Allows you to select related filters.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val zoneId: Output<String>

Identifier