Viewing docs for Cloudflare v4.16.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Viewing docs for Cloudflare v4.16.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Use this data source to look up WAF Rules.
Example Usage
The example below matches all WAF Rules that are in the group of ID
using System.Collections.Generic;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
var test = Cloudflare.GetWafRules.Invoke(new()
{
ZoneId = "ae36f999674d196762efcc5abb06b345",
PackageId = "a25a9a7e9c00afc1fb2e0245519d725b",
Filter = new Cloudflare.Inputs.GetWafRulesFilterInputArgs
{
Description = ".*example.*",
Mode = "on",
GroupId = "de677e5818985db1285d0e80225f06e5",
},
});
return new Dictionary<string, object?>
{
["wafRules"] = test.Apply(getWafRulesResult => getWafRulesResult.Rules),
};
});
package main
import (
"github.com/pulumi/pulumi-cloudflare/sdk/v4/go/cloudflare"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
test, err := cloudflare.GetWafRules(ctx, &cloudflare.GetWafRulesArgs{
ZoneId: "ae36f999674d196762efcc5abb06b345",
PackageId: pulumi.StringRef("a25a9a7e9c00afc1fb2e0245519d725b"),
Filter: cloudflare.GetWafRulesFilter{
Description: pulumi.StringRef(".*example.*"),
Mode: pulumi.StringRef("on"),
GroupId: pulumi.StringRef("de677e5818985db1285d0e80225f06e5"),
},
}, nil)
if err != nil {
return err
}
ctx.Export("wafRules", test.Rules)
return nil
})
}
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.GetWafRulesArgs;
import com.pulumi.cloudflare.inputs.GetWafRulesFilterArgs;
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 test = CloudflareFunctions.getWafRules(GetWafRulesArgs.builder()
.zoneId("ae36f999674d196762efcc5abb06b345")
.packageId("a25a9a7e9c00afc1fb2e0245519d725b")
.filter(GetWafRulesFilterArgs.builder()
.description(".*example.*")
.mode("on")
.groupId("de677e5818985db1285d0e80225f06e5")
.build())
.build());
ctx.export("wafRules", test.applyValue(getWafRulesResult -> getWafRulesResult.rules()));
}
}
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const test = cloudflare.getWafRules({
zoneId: "ae36f999674d196762efcc5abb06b345",
packageId: "a25a9a7e9c00afc1fb2e0245519d725b",
filter: {
description: ".*example.*",
mode: "on",
groupId: "de677e5818985db1285d0e80225f06e5",
},
});
export const wafRules = test.then(test => test.rules);
import pulumi
import pulumi_cloudflare as cloudflare
test = cloudflare.get_waf_rules(zone_id="ae36f999674d196762efcc5abb06b345",
package_id="a25a9a7e9c00afc1fb2e0245519d725b",
filter=cloudflare.GetWafRulesFilterArgs(
description=".*example.*",
mode="on",
group_id="de677e5818985db1285d0e80225f06e5",
))
pulumi.export("wafRules", test.rules)
variables:
test:
fn::invoke:
Function: cloudflare:getWafRules
Arguments:
zoneId: ae36f999674d196762efcc5abb06b345
packageId: a25a9a7e9c00afc1fb2e0245519d725b
filter:
description: .*example.*
mode: on
groupId: de677e5818985db1285d0e80225f06e5
outputs:
wafRules: ${test.rules}
Using getWafRules
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 getWafRules(args: GetWafRulesArgs, opts?: InvokeOptions): Promise<GetWafRulesResult>
function getWafRulesOutput(args: GetWafRulesOutputArgs, opts?: InvokeOptions): Output<GetWafRulesResult>def get_waf_rules(filter: Optional[GetWafRulesFilter] = None,
package_id: Optional[str] = None,
zone_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetWafRulesResult
def get_waf_rules_output(filter: Optional[pulumi.Input[GetWafRulesFilterArgs]] = None,
package_id: Optional[pulumi.Input[str]] = None,
zone_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetWafRulesResult]func GetWafRules(ctx *Context, args *GetWafRulesArgs, opts ...InvokeOption) (*GetWafRulesResult, error)
func GetWafRulesOutput(ctx *Context, args *GetWafRulesOutputArgs, opts ...InvokeOption) GetWafRulesResultOutput> Note: This function is named GetWafRules in the Go SDK.
public static class GetWafRules
{
public static Task<GetWafRulesResult> InvokeAsync(GetWafRulesArgs args, InvokeOptions? opts = null)
public static Output<GetWafRulesResult> Invoke(GetWafRulesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetWafRulesResult> getWafRules(GetWafRulesArgs args, InvokeOptions options)
public static Output<GetWafRulesResult> getWafRules(GetWafRulesArgs args, InvokeOptions options)
fn::invoke:
function: cloudflare:index/getWafRules:getWafRules
arguments:
# arguments dictionaryThe following arguments are supported:
- Zone
Id string - The ID of the DNS zone in which to search for the WAF Rules.
- Filter
Get
Waf Rules Filter - One or more values used to look up WAF Rules. If more than one value is given all values must match in order to be included, see below for full list.
- Package
Id string - The ID of the WAF Rule Package in which to search for the WAF Rules.
- Zone
Id string - The ID of the DNS zone in which to search for the WAF Rules.
- Filter
Get
Waf Rules Filter - One or more values used to look up WAF Rules. If more than one value is given all values must match in order to be included, see below for full list.
- Package
Id string - The ID of the WAF Rule Package in which to search for the WAF Rules.
- zone
Id String - The ID of the DNS zone in which to search for the WAF Rules.
- filter
Get
Waf Rules Filter - One or more values used to look up WAF Rules. If more than one value is given all values must match in order to be included, see below for full list.
- package
Id String - The ID of the WAF Rule Package in which to search for the WAF Rules.
- zone
Id string - The ID of the DNS zone in which to search for the WAF Rules.
- filter
Get
Waf Rules Filter - One or more values used to look up WAF Rules. If more than one value is given all values must match in order to be included, see below for full list.
- package
Id string - The ID of the WAF Rule Package in which to search for the WAF Rules.
- zone_
id str - The ID of the DNS zone in which to search for the WAF Rules.
- filter
Get
Waf Rules Filter - One or more values used to look up WAF Rules. If more than one value is given all values must match in order to be included, see below for full list.
- package_
id str - The ID of the WAF Rule Package in which to search for the WAF Rules.
- zone
Id String - The ID of the DNS zone in which to search for the WAF Rules.
- filter Property Map
- One or more values used to look up WAF Rules. If more than one value is given all values must match in order to be included, see below for full list.
- package
Id String - The ID of the WAF Rule Package in which to search for the WAF Rules.
getWafRules Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Rules
List<Get
Waf Rules Rule> - A map of WAF Rules details. Full list below:
- Zone
Id string - Filter
Get
Waf Rules Filter - Package
Id string - The ID of the WAF Rule Package that contains the WAF Rule
- Id string
- The provider-assigned unique ID for this managed resource.
- Rules
[]Get
Waf Rules Rule - A map of WAF Rules details. Full list below:
- Zone
Id string - Filter
Get
Waf Rules Filter - Package
Id string - The ID of the WAF Rule Package that contains the WAF Rule
- id String
- The provider-assigned unique ID for this managed resource.
- rules
List<Get
Waf Rules Rule> - A map of WAF Rules details. Full list below:
- zone
Id String - filter
Get
Waf Rules Filter - package
Id String - The ID of the WAF Rule Package that contains the WAF Rule
- id string
- The provider-assigned unique ID for this managed resource.
- rules
Get
Waf Rules Rule[] - A map of WAF Rules details. Full list below:
- zone
Id string - filter
Get
Waf Rules Filter - package
Id string - The ID of the WAF Rule Package that contains the WAF Rule
- id str
- The provider-assigned unique ID for this managed resource.
- rules
Sequence[Get
Waf Rules Rule] - A map of WAF Rules details. Full list below:
- zone_
id str - filter
Get
Waf Rules Filter - package_
id str - The ID of the WAF Rule Package that contains the WAF Rule
- id String
- The provider-assigned unique ID for this managed resource.
- rules List<Property Map>
- A map of WAF Rules details. Full list below:
- zone
Id String - filter Property Map
- package
Id String - The ID of the WAF Rule Package that contains the WAF Rule
Supporting Types
GetWafRulesFilter
- Description string
- A regular expression matching the description of the WAF Rules to lookup.
- Group
Id string - The ID of the WAF Rule Group in which the WAF Rules to lookup have to be.
- Mode string
- Mode of the WAF Rules to lookup. Valid values: one of ["block", "challenge", "default", "disable", "simulate"] or ["on", "off"] depending on the WAF Rule type.
- Description string
- A regular expression matching the description of the WAF Rules to lookup.
- Group
Id string - The ID of the WAF Rule Group in which the WAF Rules to lookup have to be.
- Mode string
- Mode of the WAF Rules to lookup. Valid values: one of ["block", "challenge", "default", "disable", "simulate"] or ["on", "off"] depending on the WAF Rule type.
- description String
- A regular expression matching the description of the WAF Rules to lookup.
- group
Id String - The ID of the WAF Rule Group in which the WAF Rules to lookup have to be.
- mode String
- Mode of the WAF Rules to lookup. Valid values: one of ["block", "challenge", "default", "disable", "simulate"] or ["on", "off"] depending on the WAF Rule type.
- description string
- A regular expression matching the description of the WAF Rules to lookup.
- group
Id string - The ID of the WAF Rule Group in which the WAF Rules to lookup have to be.
- mode string
- Mode of the WAF Rules to lookup. Valid values: one of ["block", "challenge", "default", "disable", "simulate"] or ["on", "off"] depending on the WAF Rule type.
- description str
- A regular expression matching the description of the WAF Rules to lookup.
- group_
id str - The ID of the WAF Rule Group in which the WAF Rules to lookup have to be.
- mode str
- Mode of the WAF Rules to lookup. Valid values: one of ["block", "challenge", "default", "disable", "simulate"] or ["on", "off"] depending on the WAF Rule type.
- description String
- A regular expression matching the description of the WAF Rules to lookup.
- group
Id String - The ID of the WAF Rule Group in which the WAF Rules to lookup have to be.
- mode String
- Mode of the WAF Rules to lookup. Valid values: one of ["block", "challenge", "default", "disable", "simulate"] or ["on", "off"] depending on the WAF Rule type.
GetWafRulesRule
- Allowed
Modes List<string> - The list of allowed
modevalues for the WAF Rule - Default
Mode string - The default
modevalue for the WAF Rule - Description string
- A regular expression matching the description of the WAF Rules to lookup.
- Group
Id string - The ID of the WAF Rule Group in which the WAF Rules to lookup have to be.
- Group
Name string - The Name of the WAF Rule Group that contains the WAF Rule
- Id string
- The WAF Rule ID
- Mode string
- Mode of the WAF Rules to lookup. Valid values: one of ["block", "challenge", "default", "disable", "simulate"] or ["on", "off"] depending on the WAF Rule type.
- Package
Id string - The ID of the WAF Rule Package in which to search for the WAF Rules.
- Priority string
- The WAF Rule priority
- Allowed
Modes []string - The list of allowed
modevalues for the WAF Rule - Default
Mode string - The default
modevalue for the WAF Rule - Description string
- A regular expression matching the description of the WAF Rules to lookup.
- Group
Id string - The ID of the WAF Rule Group in which the WAF Rules to lookup have to be.
- Group
Name string - The Name of the WAF Rule Group that contains the WAF Rule
- Id string
- The WAF Rule ID
- Mode string
- Mode of the WAF Rules to lookup. Valid values: one of ["block", "challenge", "default", "disable", "simulate"] or ["on", "off"] depending on the WAF Rule type.
- Package
Id string - The ID of the WAF Rule Package in which to search for the WAF Rules.
- Priority string
- The WAF Rule priority
- allowed
Modes List<String> - The list of allowed
modevalues for the WAF Rule - default
Mode String - The default
modevalue for the WAF Rule - description String
- A regular expression matching the description of the WAF Rules to lookup.
- group
Id String - The ID of the WAF Rule Group in which the WAF Rules to lookup have to be.
- group
Name String - The Name of the WAF Rule Group that contains the WAF Rule
- id String
- The WAF Rule ID
- mode String
- Mode of the WAF Rules to lookup. Valid values: one of ["block", "challenge", "default", "disable", "simulate"] or ["on", "off"] depending on the WAF Rule type.
- package
Id String - The ID of the WAF Rule Package in which to search for the WAF Rules.
- priority String
- The WAF Rule priority
- allowed
Modes string[] - The list of allowed
modevalues for the WAF Rule - default
Mode string - The default
modevalue for the WAF Rule - description string
- A regular expression matching the description of the WAF Rules to lookup.
- group
Id string - The ID of the WAF Rule Group in which the WAF Rules to lookup have to be.
- group
Name string - The Name of the WAF Rule Group that contains the WAF Rule
- id string
- The WAF Rule ID
- mode string
- Mode of the WAF Rules to lookup. Valid values: one of ["block", "challenge", "default", "disable", "simulate"] or ["on", "off"] depending on the WAF Rule type.
- package
Id string - The ID of the WAF Rule Package in which to search for the WAF Rules.
- priority string
- The WAF Rule priority
- allowed_
modes Sequence[str] - The list of allowed
modevalues for the WAF Rule - default_
mode str - The default
modevalue for the WAF Rule - description str
- A regular expression matching the description of the WAF Rules to lookup.
- group_
id str - The ID of the WAF Rule Group in which the WAF Rules to lookup have to be.
- group_
name str - The Name of the WAF Rule Group that contains the WAF Rule
- id str
- The WAF Rule ID
- mode str
- Mode of the WAF Rules to lookup. Valid values: one of ["block", "challenge", "default", "disable", "simulate"] or ["on", "off"] depending on the WAF Rule type.
- package_
id str - The ID of the WAF Rule Package in which to search for the WAF Rules.
- priority str
- The WAF Rule priority
- allowed
Modes List<String> - The list of allowed
modevalues for the WAF Rule - default
Mode String - The default
modevalue for the WAF Rule - description String
- A regular expression matching the description of the WAF Rules to lookup.
- group
Id String - The ID of the WAF Rule Group in which the WAF Rules to lookup have to be.
- group
Name String - The Name of the WAF Rule Group that contains the WAF Rule
- id String
- The WAF Rule ID
- mode String
- Mode of the WAF Rules to lookup. Valid values: one of ["block", "challenge", "default", "disable", "simulate"] or ["on", "off"] depending on the WAF Rule type.
- package
Id String - The ID of the WAF Rule Package in which to search for the WAF Rules.
- priority String
- The WAF Rule priority
Package Details
- Repository
- Cloudflare pulumi/pulumi-cloudflare
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cloudflareTerraform Provider.
Viewing docs for Cloudflare v4.16.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
