import * as pulumi from "@pulumi/pulumi"; /** * Define Firewall rules using filter expressions for more control over how traffic is matched to the rule. * A filter expression permits selecting traffic by multiple criteria allowing greater freedom in rule creation. * * Filter expressions needs to be created first before using Firewall Rule. See Filter. * * If you want to configure Custom Firewall rules, you need to use cloudflare_ruleset, because Custom Rules are built upon the * [Cloudflare Ruleset Engine](https://developers.cloudflare.com/ruleset-engine/). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi_cloudflare from "@mapped/pulumi-cloudflare"; * * const wordpressFilter = new cloudflare.Filter("wordpressFilter", { * zoneId: "d41d8cd98f00b204e9800998ecf8427e", * description: "Wordpress break-in attempts that are outside of the office", * expression: "(http.request.uri.path ~ \".*wp-login.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.src ne 192.0.2.1", * }); * const wordpressFirewallRule = new cloudflare.FirewallRule("wordpressFirewallRule", { * zoneId: "d41d8cd98f00b204e9800998ecf8427e", * description: "Block wordpress break-in attempts", * filterId: wordpressFilter.id, * action: "block", * }); * ``` * * ## Import * * Firewall Rule can be imported using a composite ID formed of zone ID and rule ID, e.g. * * ```sh * $ pulumi import cloudflare:index/firewallRule:FirewallRule default d41d8cd98f00b204e9800998ecf8427e/9e107d9d372bb6826bd81d3542a419d6 * ``` * * where* `d41d8cd98f00b204e9800998ecf8427e` - zone ID * `9e107d9d372bb6826bd81d3542a419d6` - rule ID as returned by [API](https://api.cloudflare.com/#zone-firewall-filter-rules) */ export declare class FirewallRule extends pulumi.CustomResource { /** * Get an existing FirewallRule resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: FirewallRuleState, opts?: pulumi.CustomResourceOptions): FirewallRule; /** * Returns true if the given object is an instance of FirewallRule. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is FirewallRule; /** * The action to apply to a matched request. Allowed values: "block", "challenge", "allow", "jsChallenge", "managedChallenge", "bypass". Enterprise plan also allows "log". */ readonly action: pulumi.Output; /** * A description of the rule to help identify it. */ readonly description: pulumi.Output; readonly filterId: pulumi.Output; /** * Whether this filter based firewall rule is currently paused. Boolean value. */ readonly paused: pulumi.Output; /** * The priority of the rule to allow control of processing order. A lower number indicates high priority. If not provided, any rules with a priority will be sequenced before those without. */ readonly priority: pulumi.Output; /** * List of products to bypass for a request when the bypass action is used. Allowed values: "zoneLockdown", "uaBlock", "bic", "hot", "securityLevel", "rateLimit", "waf". */ readonly products: pulumi.Output; /** * The DNS zone to which the Filter should be added. */ readonly zoneId: pulumi.Output; /** * Create a FirewallRule resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: FirewallRuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering FirewallRule resources. */ export interface FirewallRuleState { /** * The action to apply to a matched request. Allowed values: "block", "challenge", "allow", "jsChallenge", "managedChallenge", "bypass". Enterprise plan also allows "log". */ action?: pulumi.Input; /** * A description of the rule to help identify it. */ description?: pulumi.Input; filterId?: pulumi.Input; /** * Whether this filter based firewall rule is currently paused. Boolean value. */ paused?: pulumi.Input; /** * The priority of the rule to allow control of processing order. A lower number indicates high priority. If not provided, any rules with a priority will be sequenced before those without. */ priority?: pulumi.Input; /** * List of products to bypass for a request when the bypass action is used. Allowed values: "zoneLockdown", "uaBlock", "bic", "hot", "securityLevel", "rateLimit", "waf". */ products?: pulumi.Input[]>; /** * The DNS zone to which the Filter should be added. */ zoneId?: pulumi.Input; } /** * The set of arguments for constructing a FirewallRule resource. */ export interface FirewallRuleArgs { /** * The action to apply to a matched request. Allowed values: "block", "challenge", "allow", "jsChallenge", "managedChallenge", "bypass". Enterprise plan also allows "log". */ action: pulumi.Input; /** * A description of the rule to help identify it. */ description?: pulumi.Input; filterId: pulumi.Input; /** * Whether this filter based firewall rule is currently paused. Boolean value. */ paused?: pulumi.Input; /** * The priority of the rule to allow control of processing order. A lower number indicates high priority. If not provided, any rules with a priority will be sequenced before those without. */ priority?: pulumi.Input; /** * List of products to bypass for a request when the bypass action is used. Allowed values: "zoneLockdown", "uaBlock", "bic", "hot", "securityLevel", "rateLimit", "waf". */ products?: pulumi.Input[]>; /** * The DNS zone to which the Filter should be added. */ zoneId: pulumi.Input; }