Class: AWSCDK::WAFRegional::CfnWebACL::RuleProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::WAFRegional::CfnWebACL::RuleProperty
- Defined in:
- waf_regional/cfn_web_acl.rb
Overview
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:
- An
IPSetthat causes AWS WAF to search for web requests that originate from the IP address192.0.2.44 - A
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 from 192.0.2.44 AND include a User-Agent header for which the value is BadBot .
Instance Attribute Summary collapse
-
#action ⇒ AWSCDK::IResolvable, AWSCDK::WAFRegional::CfnWebACL::ActionProperty
readonly
The action that AWS WAF takes when a web request matches all conditions in the rule, such as allow, block, or count the request.
-
#priority ⇒ Numeric
readonly
The order in which AWS WAF evaluates the rules in a web ACL.
-
#rule_id ⇒ String
readonly
The ID of an AWS WAF Regional rule to associate with a web ACL.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(action:, priority:, rule_id:) ⇒ RuleProperty
constructor
A new instance of RuleProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(action:, priority:, rule_id:) ⇒ RuleProperty
Returns a new instance of RuleProperty.
603 604 605 606 607 608 609 610 |
# File 'waf_regional/cfn_web_acl.rb', line 603 def initialize(action:, priority:, rule_id:) @action = action.is_a?(Hash) ? ::AWSCDK::WAFRegional::CfnWebACL::ActionProperty.new(**action.transform_keys(&:to_sym)) : action Jsii::Type.check_type(@action, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZyZWdpb25hbC5DZm5XZWJBQ0wuQWN0aW9uUHJvcGVydHkifV19fQ==")), "action") @priority = priority Jsii::Type.check_type(@priority, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "priority") @rule_id = rule_id Jsii::Type.check_type(@rule_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ruleId") end |
Instance Attribute Details
#action ⇒ AWSCDK::IResolvable, AWSCDK::WAFRegional::CfnWebACL::ActionProperty (readonly)
The action that AWS WAF takes when a web request matches all conditions in the rule, such as allow, block, or count the request.
616 617 618 |
# File 'waf_regional/cfn_web_acl.rb', line 616 def action @action end |
#priority ⇒ Numeric (readonly)
The order in which AWS WAF evaluates the rules in a web ACL.
AWS WAF evaluates rules with a lower value before rules with a higher value. The value must be a unique integer. If you have multiple rules in a web ACL, the priority numbers do not need to be consecutive.
623 624 625 |
# File 'waf_regional/cfn_web_acl.rb', line 623 def priority @priority end |
#rule_id ⇒ String (readonly)
The ID of an AWS WAF Regional rule to associate with a web ACL.
628 629 630 |
# File 'waf_regional/cfn_web_acl.rb', line 628 def rule_id @rule_id end |
Class Method Details
.jsii_properties ⇒ Object
630 631 632 633 634 635 636 |
# File 'waf_regional/cfn_web_acl.rb', line 630 def self.jsii_properties { :action => "action", :priority => "priority", :rule_id => "ruleId", } end |
Instance Method Details
#to_jsii ⇒ Object
638 639 640 641 642 643 644 645 646 |
# File 'waf_regional/cfn_web_acl.rb', line 638 def to_jsii result = {} result.merge!({ "action" => @action, "priority" => @priority, "ruleId" => @rule_id, }) result.compact end |