Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

getWafRules

Use this data source to look up WAF Rules.

Example Usage

using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

class MyStack : Stack
{
    public MyStack()
    {
        var test = Output.Create(Cloudflare.GetWafRules.InvokeAsync(new Cloudflare.GetWafRulesArgs
        {
            ZoneId = "ae36f999674d196762efcc5abb06b345",
            PackageId = "a25a9a7e9c00afc1fb2e0245519d725b",
            Filter = new Cloudflare.Inputs.GetWafRulesFilterArgs
            {
                Description = ".*example.*",
                Mode = "on",
                GroupId = "de677e5818985db1285d0e80225f06e5",
            },
        }));
        this.WafRules = test.Apply(test => test.Rules);
    }

    [Output("wafRules")]
    public Output<string> WafRules { get; set; }
}
package main

import (
    "github.com/pulumi/pulumi-cloudflare/sdk/v2/go/cloudflare"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        opt0 := "a25a9a7e9c00afc1fb2e0245519d725b"
        test, err := cloudflare.GetWafRules(ctx, &cloudflare.GetWafRulesArgs{
            ZoneId:    "ae36f999674d196762efcc5abb06b345",
            PackageId: &opt0,
            Filter: cloudflare.GetWafRulesFilter{
                Description: ".*example.*",
                Mode:        "on",
                GroupId:     "de677e5818985db1285d0e80225f06e5",
            },
        }, nil)
        if err != nil {
            return err
        }
        ctx.Export("wafRules", test.Rules)
        return nil
    })
}
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)
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);

Using getWafRules

function getWafRules(args: GetWafRulesArgs, opts?: InvokeOptions): Promise<GetWafRulesResult>
def get_waf_rules(filter: Optional[GetWafRulesFilterArgs] = None, package_id: Optional[str] = None, zone_id: Optional[str] = None, opts: Optional[InvokeOptions] = None) -> GetWafRulesResult
func GetWafRules(ctx *Context, args *GetWafRulesArgs, opts ...InvokeOption) (*GetWafRulesResult, error)

Note: This function is named GetWafRules in the Go SDK.

public static class GetWafRules {
    public static Task<GetWafRulesResult> InvokeAsync(GetWafRulesArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

ZoneId string

The ID of the DNS zone in which to search for the WAF Rules.

Filter GetWafRulesFilterArgs

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.

PackageId string

The ID of the WAF Rule Package in which to search for the WAF Rules.

ZoneId string

The ID of the DNS zone in which to search for the WAF Rules.

Filter GetWafRulesFilter

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.

PackageId string

The ID of the WAF Rule Package in which to search for the WAF Rules.

zoneId string

The ID of the DNS zone in which to search for the WAF Rules.

filter GetWafRulesFilter

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.

packageId 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 GetWafRulesFilterArgs

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.

getWafRules Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Rules List<GetWafRulesRule>

A map of WAF Rules details. Full list below:

ZoneId string
Filter GetWafRulesFilter
PackageId 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 []GetWafRulesRule

A map of WAF Rules details. Full list below:

ZoneId string
Filter GetWafRulesFilter
PackageId 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 GetWafRulesRule[]

A map of WAF Rules details. Full list below:

zoneId string
filter GetWafRulesFilter
packageId 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[GetWafRulesRule]

A map of WAF Rules details. Full list below:

zone_id str
filter GetWafRulesFilter
package_id str

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.

GroupId 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.

GroupId 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.

groupId 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.

GetWafRulesRule

AllowedModes List<string>

The list of allowed mode values for the WAF Rule

Description string

A regular expression matching the description of the WAF Rules to lookup.

GroupId string

The ID of the WAF Rule Group in which the WAF Rules to lookup have to be.

GroupName 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.

PackageId string

The ID of the WAF Rule Package in which to search for the WAF Rules.

Priority string

The WAF Rule priority

AllowedModes []string

The list of allowed mode values for the WAF Rule

Description string

A regular expression matching the description of the WAF Rules to lookup.

GroupId string

The ID of the WAF Rule Group in which the WAF Rules to lookup have to be.

GroupName 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.

PackageId string

The ID of the WAF Rule Package in which to search for the WAF Rules.

Priority string

The WAF Rule priority

allowedModes string[]

The list of allowed mode values for the WAF Rule

description string

A regular expression matching the description of the WAF Rules to lookup.

groupId string

The ID of the WAF Rule Group in which the WAF Rules to lookup have to be.

groupName 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.

packageId 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 mode values 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

Package Details

Repository
https://github.com/pulumi/pulumi-cloudflare
License
Apache-2.0
Notes
This Pulumi package is based on the cloudflare Terraform Provider.