1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getWafGroups
Viewing docs for Cloudflare v4.16.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
cloudflare logo
Viewing docs for Cloudflare v4.16.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    Use this data source to look up WAF Rule Groups.

    Example Usage

    The example below matches all WAF Rule Groups that contain the word

    using System.Collections.Generic;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var test = Cloudflare.GetWafGroups.Invoke(new()
        {
            Filter = new Cloudflare.Inputs.GetWafGroupsFilterInputArgs
            {
                Name = ".*example.*",
                Mode = "on",
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["wafGroups"] = test.Apply(getWafGroupsResult => getWafGroupsResult.Groups),
        };
    });
    
    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.GetWafGroups(ctx, &cloudflare.GetWafGroupsArgs{
    			Filter: cloudflare.GetWafGroupsFilter{
    				Name: pulumi.StringRef(".*example.*"),
    				Mode: pulumi.StringRef("on"),
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("wafGroups", test.Groups)
    		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.GetWafGroupsArgs;
    import com.pulumi.cloudflare.inputs.GetWafGroupsFilterArgs;
    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.getWafGroups(GetWafGroupsArgs.builder()
                .filter(GetWafGroupsFilterArgs.builder()
                    .name(".*example.*")
                    .mode("on")
                    .build())
                .build());
    
            ctx.export("wafGroups", test.applyValue(getWafGroupsResult -> getWafGroupsResult.groups()));
        }
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const test = cloudflare.getWafGroups({
        filter: {
            name: ".*example.*",
            mode: "on",
        },
    });
    export const wafGroups = test.then(test => test.groups);
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    test = cloudflare.get_waf_groups(filter=cloudflare.GetWafGroupsFilterArgs(
        name=".*example.*",
        mode="on",
    ))
    pulumi.export("wafGroups", test.groups)
    
    variables:
      test:
        fn::invoke:
          Function: cloudflare:getWafGroups
          Arguments:
            filter:
              name: .*example.*
              mode: on
    outputs:
      wafGroups: ${test.groups}
    

    Using getWafGroups

    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 getWafGroups(args: GetWafGroupsArgs, opts?: InvokeOptions): Promise<GetWafGroupsResult>
    function getWafGroupsOutput(args: GetWafGroupsOutputArgs, opts?: InvokeOptions): Output<GetWafGroupsResult>
    def get_waf_groups(filter: Optional[GetWafGroupsFilter] = None,
                       package_id: Optional[str] = None,
                       zone_id: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetWafGroupsResult
    def get_waf_groups_output(filter: Optional[pulumi.Input[GetWafGroupsFilterArgs]] = None,
                       package_id: Optional[pulumi.Input[str]] = None,
                       zone_id: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetWafGroupsResult]
    func GetWafGroups(ctx *Context, args *GetWafGroupsArgs, opts ...InvokeOption) (*GetWafGroupsResult, error)
    func GetWafGroupsOutput(ctx *Context, args *GetWafGroupsOutputArgs, opts ...InvokeOption) GetWafGroupsResultOutput

    > Note: This function is named GetWafGroups in the Go SDK.

    public static class GetWafGroups 
    {
        public static Task<GetWafGroupsResult> InvokeAsync(GetWafGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetWafGroupsResult> Invoke(GetWafGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetWafGroupsResult> getWafGroups(GetWafGroupsArgs args, InvokeOptions options)
    public static Output<GetWafGroupsResult> getWafGroups(GetWafGroupsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: cloudflare:index/getWafGroups:getWafGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ZoneId string
    The ID of the DNS zone in which to search for the WAF Rule Groups.
    Filter GetWafGroupsFilter
    One or more values used to look up WAF Rule Groups. If more than one value is given all values must match in order to be included, see below for full list.
    PackageId string
    The ID of the WAF Rule Package in which to search for the WAF Rule Groups.
    ZoneId string
    The ID of the DNS zone in which to search for the WAF Rule Groups.
    Filter GetWafGroupsFilter
    One or more values used to look up WAF Rule Groups. If more than one value is given all values must match in order to be included, see below for full list.
    PackageId string
    The ID of the WAF Rule Package in which to search for the WAF Rule Groups.
    zoneId String
    The ID of the DNS zone in which to search for the WAF Rule Groups.
    filter GetWafGroupsFilter
    One or more values used to look up WAF Rule Groups. If more than one value is given all values must match in order to be included, see below for full list.
    packageId String
    The ID of the WAF Rule Package in which to search for the WAF Rule Groups.
    zoneId string
    The ID of the DNS zone in which to search for the WAF Rule Groups.
    filter GetWafGroupsFilter
    One or more values used to look up WAF Rule Groups. If more than one value is given all values must match in order to be included, see below for full list.
    packageId string
    The ID of the WAF Rule Package in which to search for the WAF Rule Groups.
    zone_id str
    The ID of the DNS zone in which to search for the WAF Rule Groups.
    filter GetWafGroupsFilter
    One or more values used to look up WAF Rule Groups. 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 Rule Groups.
    zoneId String
    The ID of the DNS zone in which to search for the WAF Rule Groups.
    filter Property Map
    One or more values used to look up WAF Rule Groups. If more than one value is given all values must match in order to be included, see below for full list.
    packageId String
    The ID of the WAF Rule Package in which to search for the WAF Rule Groups.

    getWafGroups Result

    The following output properties are available:

    Groups List<GetWafGroupsGroup>
    A map of WAF Rule Groups details. Full list below:
    Id string
    The provider-assigned unique ID for this managed resource.
    ZoneId string
    Filter GetWafGroupsFilter
    PackageId string
    The ID of the WAF Rule Package that contains the WAF Rule Group
    Groups []GetWafGroupsGroup
    A map of WAF Rule Groups details. Full list below:
    Id string
    The provider-assigned unique ID for this managed resource.
    ZoneId string
    Filter GetWafGroupsFilter
    PackageId string
    The ID of the WAF Rule Package that contains the WAF Rule Group
    groups List<GetWafGroupsGroup>
    A map of WAF Rule Groups details. Full list below:
    id String
    The provider-assigned unique ID for this managed resource.
    zoneId String
    filter GetWafGroupsFilter
    packageId String
    The ID of the WAF Rule Package that contains the WAF Rule Group
    groups GetWafGroupsGroup[]
    A map of WAF Rule Groups details. Full list below:
    id string
    The provider-assigned unique ID for this managed resource.
    zoneId string
    filter GetWafGroupsFilter
    packageId string
    The ID of the WAF Rule Package that contains the WAF Rule Group
    groups Sequence[GetWafGroupsGroup]
    A map of WAF Rule Groups details. Full list below:
    id str
    The provider-assigned unique ID for this managed resource.
    zone_id str
    filter GetWafGroupsFilter
    package_id str
    The ID of the WAF Rule Package that contains the WAF Rule Group
    groups List<Property Map>
    A map of WAF Rule Groups details. Full list below:
    id String
    The provider-assigned unique ID for this managed resource.
    zoneId String
    filter Property Map
    packageId String
    The ID of the WAF Rule Package that contains the WAF Rule Group

    Supporting Types

    GetWafGroupsFilter

    Mode string
    Mode of the WAF Rule Groups to lookup. Valid values: on and off.
    Name string
    A regular expression matching the name of the WAF Rule Groups to lookup.
    Mode string
    Mode of the WAF Rule Groups to lookup. Valid values: on and off.
    Name string
    A regular expression matching the name of the WAF Rule Groups to lookup.
    mode String
    Mode of the WAF Rule Groups to lookup. Valid values: on and off.
    name String
    A regular expression matching the name of the WAF Rule Groups to lookup.
    mode string
    Mode of the WAF Rule Groups to lookup. Valid values: on and off.
    name string
    A regular expression matching the name of the WAF Rule Groups to lookup.
    mode str
    Mode of the WAF Rule Groups to lookup. Valid values: on and off.
    name str
    A regular expression matching the name of the WAF Rule Groups to lookup.
    mode String
    Mode of the WAF Rule Groups to lookup. Valid values: on and off.
    name String
    A regular expression matching the name of the WAF Rule Groups to lookup.

    GetWafGroupsGroup

    Description string
    The WAF Rule Group description
    Id string
    The WAF Rule Group ID
    Mode string
    Mode of the WAF Rule Groups to lookup. Valid values: on and off.
    ModifiedRulesCount int
    The number of modified rules in the WAF Rule Group
    Name string
    A regular expression matching the name of the WAF Rule Groups to lookup.
    PackageId string
    The ID of the WAF Rule Package in which to search for the WAF Rule Groups.
    RulesCount int
    The number of rules in the WAF Rule Group
    Description string
    The WAF Rule Group description
    Id string
    The WAF Rule Group ID
    Mode string
    Mode of the WAF Rule Groups to lookup. Valid values: on and off.
    ModifiedRulesCount int
    The number of modified rules in the WAF Rule Group
    Name string
    A regular expression matching the name of the WAF Rule Groups to lookup.
    PackageId string
    The ID of the WAF Rule Package in which to search for the WAF Rule Groups.
    RulesCount int
    The number of rules in the WAF Rule Group
    description String
    The WAF Rule Group description
    id String
    The WAF Rule Group ID
    mode String
    Mode of the WAF Rule Groups to lookup. Valid values: on and off.
    modifiedRulesCount Integer
    The number of modified rules in the WAF Rule Group
    name String
    A regular expression matching the name of the WAF Rule Groups to lookup.
    packageId String
    The ID of the WAF Rule Package in which to search for the WAF Rule Groups.
    rulesCount Integer
    The number of rules in the WAF Rule Group
    description string
    The WAF Rule Group description
    id string
    The WAF Rule Group ID
    mode string
    Mode of the WAF Rule Groups to lookup. Valid values: on and off.
    modifiedRulesCount number
    The number of modified rules in the WAF Rule Group
    name string
    A regular expression matching the name of the WAF Rule Groups to lookup.
    packageId string
    The ID of the WAF Rule Package in which to search for the WAF Rule Groups.
    rulesCount number
    The number of rules in the WAF Rule Group
    description str
    The WAF Rule Group description
    id str
    The WAF Rule Group ID
    mode str
    Mode of the WAF Rule Groups to lookup. Valid values: on and off.
    modified_rules_count int
    The number of modified rules in the WAF Rule Group
    name str
    A regular expression matching the name of the WAF Rule Groups to lookup.
    package_id str
    The ID of the WAF Rule Package in which to search for the WAF Rule Groups.
    rules_count int
    The number of rules in the WAF Rule Group
    description String
    The WAF Rule Group description
    id String
    The WAF Rule Group ID
    mode String
    Mode of the WAF Rule Groups to lookup. Valid values: on and off.
    modifiedRulesCount Number
    The number of modified rules in the WAF Rule Group
    name String
    A regular expression matching the name of the WAF Rule Groups to lookup.
    packageId String
    The ID of the WAF Rule Package in which to search for the WAF Rule Groups.
    rulesCount Number
    The number of rules in the WAF Rule Group

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo
    Viewing docs for Cloudflare v4.16.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.