Class CfnRule
This is AWS WAF Classic documentation.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.WAF
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnRule : CfnResource, IInspectable
Syntax (vb)
Public Class CfnRule
Inherits CfnResource
Implements IInspectable
Remarks
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
.
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-waf-rule.html
CloudformationResource: AWS::WAF::Rule
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(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 |
CfnRule(Construct, String, ICfnRuleProps) |
Properties
AttrId | |
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(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
CfnRule(Construct, String, ICfnRuleProps)
public CfnRule(Construct scope, string id, ICfnRuleProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnRuleProps
Resource properties.
Properties
AttrId
public virtual string AttrId { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Id
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
Name
The friendly name or description for the Rule
.
public virtual string Name { get; set; }
Property Value
System.String
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
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>