1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. WafPackage
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 package resource for a particular zone. This can be used to configure firewall behaviour for pre-defined firewall packages.

    Example Usage

    using System.Collections.Generic;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var owasp = new Cloudflare.WafPackage("owasp", new()
        {
            ActionMode = "simulate",
            PackageId = "a25a9a7e9c00afc1fb2e0245519d725b",
            Sensitivity = "medium",
            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.NewWafPackage(ctx, "owasp", &cloudflare.WafPackageArgs{
    			ActionMode:  pulumi.String("simulate"),
    			PackageId:   pulumi.String("a25a9a7e9c00afc1fb2e0245519d725b"),
    			Sensitivity: pulumi.String("medium"),
    			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.WafPackage;
    import com.pulumi.cloudflare.WafPackageArgs;
    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 owasp = new WafPackage("owasp", WafPackageArgs.builder()        
                .actionMode("simulate")
                .packageId("a25a9a7e9c00afc1fb2e0245519d725b")
                .sensitivity("medium")
                .zoneId("ae36f999674d196762efcc5abb06b345")
                .build());
    
        }
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const owasp = new cloudflare.WafPackage("owasp", {
        actionMode: "simulate",
        packageId: "a25a9a7e9c00afc1fb2e0245519d725b",
        sensitivity: "medium",
        zoneId: "ae36f999674d196762efcc5abb06b345",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    owasp = cloudflare.WafPackage("owasp",
        action_mode="simulate",
        package_id="a25a9a7e9c00afc1fb2e0245519d725b",
        sensitivity="medium",
        zone_id="ae36f999674d196762efcc5abb06b345")
    
    resources:
      owasp:
        type: cloudflare:WafPackage
        properties:
          actionMode: simulate
          packageId: a25a9a7e9c00afc1fb2e0245519d725b
          sensitivity: medium
          zoneId: ae36f999674d196762efcc5abb06b345
    

    Create WafPackage Resource

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

    Constructor syntax

    new WafPackage(name: string, args: WafPackageArgs, opts?: CustomResourceOptions);
    @overload
    def WafPackage(resource_name: str,
                   args: WafPackageArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def WafPackage(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   package_id: Optional[str] = None,
                   zone_id: Optional[str] = None,
                   action_mode: Optional[str] = None,
                   sensitivity: Optional[str] = None)
    func NewWafPackage(ctx *Context, name string, args WafPackageArgs, opts ...ResourceOption) (*WafPackage, error)
    public WafPackage(string name, WafPackageArgs args, CustomResourceOptions? opts = null)
    public WafPackage(String name, WafPackageArgs args)
    public WafPackage(String name, WafPackageArgs args, CustomResourceOptions options)
    
    type: cloudflare:WafPackage
    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 WafPackageArgs
    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 WafPackageArgs
    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 WafPackageArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WafPackageArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WafPackageArgs
    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 wafPackageResource = new Cloudflare.WafPackage("wafPackageResource", new()
    {
        PackageId = "string",
        ZoneId = "string",
        ActionMode = "string",
        Sensitivity = "string",
    });
    
    example, err := cloudflare.NewWafPackage(ctx, "wafPackageResource", &cloudflare.WafPackageArgs{
    	PackageId:   pulumi.String("string"),
    	ZoneId:      pulumi.String("string"),
    	ActionMode:  pulumi.String("string"),
    	Sensitivity: pulumi.String("string"),
    })
    
    var wafPackageResource = new WafPackage("wafPackageResource", WafPackageArgs.builder()
        .packageId("string")
        .zoneId("string")
        .actionMode("string")
        .sensitivity("string")
        .build());
    
    waf_package_resource = cloudflare.WafPackage("wafPackageResource",
        package_id="string",
        zone_id="string",
        action_mode="string",
        sensitivity="string")
    
    const wafPackageResource = new cloudflare.WafPackage("wafPackageResource", {
        packageId: "string",
        zoneId: "string",
        actionMode: "string",
        sensitivity: "string",
    });
    
    type: cloudflare:WafPackage
    properties:
        actionMode: string
        packageId: string
        sensitivity: string
        zoneId: string
    

    WafPackage 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 WafPackage resource accepts the following input properties:

    PackageId string
    The WAF Package ID.
    ZoneId string
    The DNS zone ID to apply to.
    ActionMode string
    The action mode of the package, can be one of ["block", "challenge", "simulate"].
    Sensitivity string
    The sensitivity of the package, can be one of ["high", "medium", "low", "off"].
    PackageId string
    The WAF Package ID.
    ZoneId string
    The DNS zone ID to apply to.
    ActionMode string
    The action mode of the package, can be one of ["block", "challenge", "simulate"].
    Sensitivity string
    The sensitivity of the package, can be one of ["high", "medium", "low", "off"].
    packageId String
    The WAF Package ID.
    zoneId String
    The DNS zone ID to apply to.
    actionMode String
    The action mode of the package, can be one of ["block", "challenge", "simulate"].
    sensitivity String
    The sensitivity of the package, can be one of ["high", "medium", "low", "off"].
    packageId string
    The WAF Package ID.
    zoneId string
    The DNS zone ID to apply to.
    actionMode string
    The action mode of the package, can be one of ["block", "challenge", "simulate"].
    sensitivity string
    The sensitivity of the package, can be one of ["high", "medium", "low", "off"].
    package_id str
    The WAF Package ID.
    zone_id str
    The DNS zone ID to apply to.
    action_mode str
    The action mode of the package, can be one of ["block", "challenge", "simulate"].
    sensitivity str
    The sensitivity of the package, can be one of ["high", "medium", "low", "off"].
    packageId String
    The WAF Package ID.
    zoneId String
    The DNS zone ID to apply to.
    actionMode String
    The action mode of the package, can be one of ["block", "challenge", "simulate"].
    sensitivity String
    The sensitivity of the package, can be one of ["high", "medium", "low", "off"].

    Outputs

    All input properties are implicitly available as output properties. Additionally, the WafPackage 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 WafPackage Resource

    Get an existing WafPackage 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?: WafPackageState, opts?: CustomResourceOptions): WafPackage
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            action_mode: Optional[str] = None,
            package_id: Optional[str] = None,
            sensitivity: Optional[str] = None,
            zone_id: Optional[str] = None) -> WafPackage
    func GetWafPackage(ctx *Context, name string, id IDInput, state *WafPackageState, opts ...ResourceOption) (*WafPackage, error)
    public static WafPackage Get(string name, Input<string> id, WafPackageState? state, CustomResourceOptions? opts = null)
    public static WafPackage get(String name, Output<String> id, WafPackageState state, CustomResourceOptions options)
    resources:  _:    type: cloudflare:WafPackage    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:
    ActionMode string
    The action mode of the package, can be one of ["block", "challenge", "simulate"].
    PackageId string
    The WAF Package ID.
    Sensitivity string
    The sensitivity of the package, can be one of ["high", "medium", "low", "off"].
    ZoneId string
    The DNS zone ID to apply to.
    ActionMode string
    The action mode of the package, can be one of ["block", "challenge", "simulate"].
    PackageId string
    The WAF Package ID.
    Sensitivity string
    The sensitivity of the package, can be one of ["high", "medium", "low", "off"].
    ZoneId string
    The DNS zone ID to apply to.
    actionMode String
    The action mode of the package, can be one of ["block", "challenge", "simulate"].
    packageId String
    The WAF Package ID.
    sensitivity String
    The sensitivity of the package, can be one of ["high", "medium", "low", "off"].
    zoneId String
    The DNS zone ID to apply to.
    actionMode string
    The action mode of the package, can be one of ["block", "challenge", "simulate"].
    packageId string
    The WAF Package ID.
    sensitivity string
    The sensitivity of the package, can be one of ["high", "medium", "low", "off"].
    zoneId string
    The DNS zone ID to apply to.
    action_mode str
    The action mode of the package, can be one of ["block", "challenge", "simulate"].
    package_id str
    The WAF Package ID.
    sensitivity str
    The sensitivity of the package, can be one of ["high", "medium", "low", "off"].
    zone_id str
    The DNS zone ID to apply to.
    actionMode String
    The action mode of the package, can be one of ["block", "challenge", "simulate"].
    packageId String
    The WAF Package ID.
    sensitivity String
    The sensitivity of the package, can be one of ["high", "medium", "low", "off"].
    zoneId String
    The DNS zone ID to apply to.

    Import

    Packages can be imported using a composite ID formed of zone ID and the WAF Package ID, e.g.

     $ pulumi import cloudflare:index/wafPackage:WafPackage owasp ae36f999674d196762efcc5abb06b345/a25a9a7e9c00afc1fb2e0245519d725b
    

    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.