Show / Hide Table of Contents

Class FirewallRule

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.

Example Usage

using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

class MyStack : Stack
{
public MyStack()
{
    var wordpressFilter = new Cloudflare.Filter("wordpressFilter", new Cloudflare.FilterArgs
    {
        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",
    });
    var wordpressFirewallRule = new Cloudflare.FirewallRule("wordpressFirewallRule", new Cloudflare.FirewallRuleArgs
    {
        ZoneId = "d41d8cd98f00b204e9800998ecf8427e",
        Description = "Block wordpress break-in attempts",
        FilterId = wordpressFilter.Id,
        Action = "block",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
FirewallRule
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Cloudflare
Assembly: Pulumi.Cloudflare.dll
Syntax
public class FirewallRule : CustomResource

Constructors

View Source

FirewallRule(String, FirewallRuleArgs, CustomResourceOptions)

Create a FirewallRule resource with the given unique name, arguments, and options.

Declaration
public FirewallRule(string name, FirewallRuleArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

FirewallRuleArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Action

The action to apply to a matched request. Allowed values: "block", "challenge", "allow", "js_challenge", "bypass". Enterprise plan also allows "log".

Declaration
public Output<string> Action { get; }
Property Value
Type Description
Output<System.String>
View Source

Description

A description of the rule to help identify it.

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

FilterId

Declaration
public Output<string> FilterId { get; }
Property Value
Type Description
Output<System.String>
View Source

Paused

Whether this filter based firewall rule is currently paused. Boolean value.

Declaration
public Output<bool?> Paused { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Priority

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.

Declaration
public Output<int?> Priority { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

Products

List of products to bypass for a request when the bypass action is used. Allowed values: "zoneLockdown", "uaBlock", "bic", "hot", "securityLevel", "rateLimit", "waf".

Declaration
public Output<ImmutableArray<string>> Products { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

ZoneId

The DNS zone to which the Filter should be added.

Declaration
public Output<string> ZoneId { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, FirewallRuleState, CustomResourceOptions)

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

Declaration
public static FirewallRule Get(string name, Input<string> id, FirewallRuleState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

FirewallRuleState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
FirewallRule
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.