1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. WafGroup
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

    Provides a Cloudflare WAF rule group resource for a particular zone. This can be used to configure firewall behaviour for pre-defined firewall groups.

    Example Usage

    using System.Collections.Generic;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var honeyPot = new Cloudflare.WafGroup("honeyPot", new()
        {
            GroupId = "de677e5818985db1285d0e80225f06e5",
            Mode = "on",
            ZoneId = "ae36f999674d196762efcc5abb06b345",
        });
    
    });
    
    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 {
    		_, err := cloudflare.NewWafGroup(ctx, "honeyPot", &cloudflare.WafGroupArgs{
    			GroupId: pulumi.String("de677e5818985db1285d0e80225f06e5"),
    			Mode:    pulumi.String("on"),
    			ZoneId:  pulumi.String("ae36f999674d196762efcc5abb06b345"),
    		})
    		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.WafGroup;
    import com.pulumi.cloudflare.WafGroupArgs;
    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 honeyPot = new WafGroup("honeyPot", WafGroupArgs.builder()        
                .groupId("de677e5818985db1285d0e80225f06e5")
                .mode("on")
                .zoneId("ae36f999674d196762efcc5abb06b345")
                .build());
    
        }
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const honeyPot = new cloudflare.WafGroup("honeyPot", {
        groupId: "de677e5818985db1285d0e80225f06e5",
        mode: "on",
        zoneId: "ae36f999674d196762efcc5abb06b345",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    honey_pot = cloudflare.WafGroup("honeyPot",
        group_id="de677e5818985db1285d0e80225f06e5",
        mode="on",
        zone_id="ae36f999674d196762efcc5abb06b345")
    
    resources:
      honeyPot:
        type: cloudflare:WafGroup
        properties:
          groupId: de677e5818985db1285d0e80225f06e5
          mode: on
          zoneId: ae36f999674d196762efcc5abb06b345
    

    Create WafGroup Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new WafGroup(name: string, args: WafGroupArgs, opts?: CustomResourceOptions);
    @overload
    def WafGroup(resource_name: str,
                 args: WafGroupArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def WafGroup(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 group_id: Optional[str] = None,
                 zone_id: Optional[str] = None,
                 mode: Optional[str] = None,
                 package_id: Optional[str] = None)
    func NewWafGroup(ctx *Context, name string, args WafGroupArgs, opts ...ResourceOption) (*WafGroup, error)
    public WafGroup(string name, WafGroupArgs args, CustomResourceOptions? opts = null)
    public WafGroup(String name, WafGroupArgs args)
    public WafGroup(String name, WafGroupArgs args, CustomResourceOptions options)
    
    type: cloudflare:WafGroup
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args WafGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args WafGroupArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args WafGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WafGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WafGroupArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var wafGroupResource = new Cloudflare.WafGroup("wafGroupResource", new()
    {
        GroupId = "string",
        ZoneId = "string",
        Mode = "string",
        PackageId = "string",
    });
    
    example, err := cloudflare.NewWafGroup(ctx, "wafGroupResource", &cloudflare.WafGroupArgs{
    	GroupId:   pulumi.String("string"),
    	ZoneId:    pulumi.String("string"),
    	Mode:      pulumi.String("string"),
    	PackageId: pulumi.String("string"),
    })
    
    var wafGroupResource = new WafGroup("wafGroupResource", WafGroupArgs.builder()
        .groupId("string")
        .zoneId("string")
        .mode("string")
        .packageId("string")
        .build());
    
    waf_group_resource = cloudflare.WafGroup("wafGroupResource",
        group_id="string",
        zone_id="string",
        mode="string",
        package_id="string")
    
    const wafGroupResource = new cloudflare.WafGroup("wafGroupResource", {
        groupId: "string",
        zoneId: "string",
        mode: "string",
        packageId: "string",
    });
    
    type: cloudflare:WafGroup
    properties:
        groupId: string
        mode: string
        packageId: string
        zoneId: string
    

    WafGroup Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The WafGroup resource accepts the following input properties:

    GroupId string
    The WAF Rule Group ID.
    ZoneId string
    The DNS zone ID to apply to.
    Mode string
    The mode of the group, can be one of ["on", "off"].
    PackageId string
    The ID of the WAF Rule Package that contains the group.
    GroupId string
    The WAF Rule Group ID.
    ZoneId string
    The DNS zone ID to apply to.
    Mode string
    The mode of the group, can be one of ["on", "off"].
    PackageId string
    The ID of the WAF Rule Package that contains the group.
    groupId String
    The WAF Rule Group ID.
    zoneId String
    The DNS zone ID to apply to.
    mode String
    The mode of the group, can be one of ["on", "off"].
    packageId String
    The ID of the WAF Rule Package that contains the group.
    groupId string
    The WAF Rule Group ID.
    zoneId string
    The DNS zone ID to apply to.
    mode string
    The mode of the group, can be one of ["on", "off"].
    packageId string
    The ID of the WAF Rule Package that contains the group.
    group_id str
    The WAF Rule Group ID.
    zone_id str
    The DNS zone ID to apply to.
    mode str
    The mode of the group, can be one of ["on", "off"].
    package_id str
    The ID of the WAF Rule Package that contains the group.
    groupId String
    The WAF Rule Group ID.
    zoneId String
    The DNS zone ID to apply to.
    mode String
    The mode of the group, can be one of ["on", "off"].
    packageId String
    The ID of the WAF Rule Package that contains the group.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the WafGroup resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing WafGroup Resource

    Get an existing WafGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: WafGroupState, opts?: CustomResourceOptions): WafGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            group_id: Optional[str] = None,
            mode: Optional[str] = None,
            package_id: Optional[str] = None,
            zone_id: Optional[str] = None) -> WafGroup
    func GetWafGroup(ctx *Context, name string, id IDInput, state *WafGroupState, opts ...ResourceOption) (*WafGroup, error)
    public static WafGroup Get(string name, Input<string> id, WafGroupState? state, CustomResourceOptions? opts = null)
    public static WafGroup get(String name, Output<String> id, WafGroupState state, CustomResourceOptions options)
    resources:  _:    type: cloudflare:WafGroup    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    GroupId string
    The WAF Rule Group ID.
    Mode string
    The mode of the group, can be one of ["on", "off"].
    PackageId string
    The ID of the WAF Rule Package that contains the group.
    ZoneId string
    The DNS zone ID to apply to.
    GroupId string
    The WAF Rule Group ID.
    Mode string
    The mode of the group, can be one of ["on", "off"].
    PackageId string
    The ID of the WAF Rule Package that contains the group.
    ZoneId string
    The DNS zone ID to apply to.
    groupId String
    The WAF Rule Group ID.
    mode String
    The mode of the group, can be one of ["on", "off"].
    packageId String
    The ID of the WAF Rule Package that contains the group.
    zoneId String
    The DNS zone ID to apply to.
    groupId string
    The WAF Rule Group ID.
    mode string
    The mode of the group, can be one of ["on", "off"].
    packageId string
    The ID of the WAF Rule Package that contains the group.
    zoneId string
    The DNS zone ID to apply to.
    group_id str
    The WAF Rule Group ID.
    mode str
    The mode of the group, can be one of ["on", "off"].
    package_id str
    The ID of the WAF Rule Package that contains the group.
    zone_id str
    The DNS zone ID to apply to.
    groupId String
    The WAF Rule Group ID.
    mode String
    The mode of the group, can be one of ["on", "off"].
    packageId String
    The ID of the WAF Rule Package that contains the group.
    zoneId String
    The DNS zone ID to apply to.

    Import

    WAF Rule Groups can be imported using a composite ID formed of zone ID and the WAF Rule Group ID, e.g.

     $ pulumi import cloudflare:index/wafGroup:WafGroup honey_pot ae36f999674d196762efcc5abb06b345/de677e5818985db1285d0e80225f06e5
    

    To learn more about importing existing cloud resources, see Importing resources.

    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.