CfnRulePropsMixin
- class aws_cdk.mixins_preview.aws_wafregional.mixins.CfnRulePropsMixin(props, *, strategy=None)
Bases:
MixinThis is AWS WAF Classic documentation.
For more information, see AWS WAF Classic in the developer guide. .. epigraph:
*For the latest version of AWS WAF* , use the AWS WAF V2 API and see the `AWS WAF Developer Guide <https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html>`_ . With the latest version, AWS WAF has a single set of endpoints for regional and global use.
A combination of
ByteMatchSet,IPSet, and/orSqlInjectionMatchSetobjects that identify the web requests that you want to allow, block, or count. For example, you might create aRulethat includes the following predicates:An
IPSetthat causes AWS WAF to search for web requests that originate from the IP address192.0.2.44A
ByteMatchSetthat causes AWS WAF to search for web requests for which the value of theUser-Agentheader isBadBot.
To match the settings in this
Rule, a request must originate from192.0.2.44AND include aUser-Agentheader for which the value isBadBot.- see:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafregional-rule.html
- cloudformationResource:
AWS::WAFRegional::Rule
- mixin:
true
- exampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_wafregional import mixins as wafregional_mixins cfn_rule_props_mixin = wafregional_mixins.CfnRulePropsMixin(wafregional_mixins.CfnRuleMixinProps( metric_name="metricName", name="name", predicates=[wafregional_mixins.CfnRulePropsMixin.PredicateProperty( data_id="dataId", negated=False, type="type" )] ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::WAFRegional::Rule.- Parameters:
props (
Union[CfnRuleMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['metricName', 'name', 'predicates']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
PredicateProperty
- class CfnRulePropsMixin.PredicateProperty(*, data_id=None, negated=None, type=None)
Bases:
objectSpecifies the
ByteMatchSet,IPSet,SqlInjectionMatchSet,XssMatchSet,RegexMatchSet,GeoMatchSet, andSizeConstraintSetobjects that you want to add to aRuleand, for each object, indicates whether you want to negate the settings, for example, requests that do NOT originate from the IP address 192.0.2.44.- Parameters:
data_id (
Optional[str]) – A unique identifier for a predicate in aRule, such asByteMatchSetIdorIPSetId. The ID is returned by the correspondingCreateorListcommand.negated (
Union[bool,IResolvable,None]) – SetNegatedtoFalseif you want AWS WAF to allow, block, or count requests based on the settings in the specifiedByteMatchSet,IPSet,SqlInjectionMatchSet,XssMatchSet,RegexMatchSet,GeoMatchSet, orSizeConstraintSet. For example, if anIPSetincludes the IP address192.0.2.44, AWS WAF will allow or block requests based on that IP address. SetNegatedtoTrueif you want AWS WAF to allow or block a request based on the negation of the settings in theByteMatchSet,IPSet,SqlInjectionMatchSet,XssMatchSet,RegexMatchSet,GeoMatchSet, orSizeConstraintSet. For example, if anIPSetincludes the IP address192.0.2.44, AWS WAF will allow, block, or count requests based on all IP addresses except192.0.2.44.type (
Optional[str]) – The type of predicate in aRule, such asByteMatchorIPSet.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_wafregional import mixins as wafregional_mixins predicate_property = wafregional_mixins.CfnRulePropsMixin.PredicateProperty( data_id="dataId", negated=False, type="type" )
Attributes
- data_id
A unique identifier for a predicate in a
Rule, such asByteMatchSetIdorIPSetId.The ID is returned by the corresponding
CreateorListcommand.
- negated
Set
NegatedtoFalseif you want AWS WAF to allow, block, or count requests based on the settings in the specifiedByteMatchSet,IPSet,SqlInjectionMatchSet,XssMatchSet,RegexMatchSet,GeoMatchSet, orSizeConstraintSet.For example, if an
IPSetincludes the IP address192.0.2.44, AWS WAF will allow or block requests based on that IP address.Set
NegatedtoTrueif you want AWS WAF to allow or block a request based on the negation of the settings in theByteMatchSet,IPSet,SqlInjectionMatchSet,XssMatchSet,RegexMatchSet,GeoMatchSet, orSizeConstraintSet. For example, if anIPSetincludes the IP address192.0.2.44, AWS WAF will allow, block, or count requests based on all IP addresses except192.0.2.44.
- type
The type of predicate in a
Rule, such asByteMatchorIPSet.