Class CfnRule
A CloudFormation AWS::WAF::Rule
.
Inherited Members
Namespace: Amazon.CDK.AWS.WAF
Assembly: Amazon.CDK.AWS.WAF.dll
Syntax (csharp)
public class CfnRule : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnRule
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the developer guide.
For the latest version of AWS WAF , use the AWS WAF V2 API and see the AWS WAF Developer Guide . With the latest version, AWS WAF has a single set of endpoints for regional and global use.
A combination of ByteMatchSet
, IPSet
, and/or SqlInjectionMatchSet
objects that identify the web requests that you want to allow, block, or count. For example, you might create a Rule
that includes the following predicates:
To match the settings in this Rule
, a request must originate from 192.0.2.44
AND include a User-Agent
header for which the value is BadBot
.
CloudformationResource: AWS::WAF::Rule
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-waf-rule.html
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.WAF;
var cfnRule = new CfnRule(this, "MyCfnRule", new CfnRuleProps {
MetricName = "metricName",
Name = "name",
// the properties below are optional
Predicates = new [] { new PredicateProperty {
DataId = "dataId",
Negated = false,
Type = "type"
} }
});
Synopsis
Constructors
CfnRule(Construct, String, ICfnRuleProps) | Create a new |
CfnRule(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnRule(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
MetricName | The name of the metrics for this |
Name | The friendly name or description for the |
Predicates | The |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnRule(Construct, String, ICfnRuleProps)
Create a new AWS::WAF::Rule
.
public CfnRule(Construct scope, string id, ICfnRuleProps props)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnRuleProps
- resource properties.
CfnRule(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnRule(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnRule(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnRule(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
MetricName
The name of the metrics for this Rule
.
public virtual string MetricName { get; set; }
Property Value
System.String
Remarks
The name can contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum length 128 and minimum length one. It can't contain whitespace or metric names reserved for AWS WAF , including "All" and "Default_Action." You can't change MetricName
after you create the Rule
.
Name
The friendly name or description for the Rule
.
public virtual string Name { get; set; }
Property Value
System.String
Remarks
You can't change the name of a Rule
after you create it.
Predicates
The Predicates
object contains one Predicate
element for each ByteMatchSet
, IPSet
, or SqlInjectionMatchSet
object that you want to include in a Rule
.
public virtual object Predicates { get; set; }
Property Value
System.Object
Remarks
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>