Class: AWSCDK::WAF::CfnWebACL::ActivatedRuleProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::WAF::CfnWebACL::ActivatedRuleProperty
- Defined in:
- waf/cfn_web_acl.rb
Overview
The ActivatedRule object in an UpdateWebACL request specifies a Rule that you want to insert or delete, the priority of the Rule in the WebACL , and the action that you want AWS WAF to take when a web request matches the Rule ( ALLOW , BLOCK , or COUNT ).
To specify whether to insert or delete a Rule , use the Action parameter in the WebACLUpdate data type.
Instance Attribute Summary collapse
-
#action ⇒ AWSCDK::IResolvable, ...
readonly
Specifies the action that Amazon CloudFront or AWS WAF takes when a web request matches the conditions in the
Rule. -
#priority ⇒ Numeric
readonly
Specifies the order in which the
Rulesin aWebACLare evaluated. -
#rule_id ⇒ String
readonly
The
RuleIdfor aRule.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(priority:, rule_id:, action: nil) ⇒ ActivatedRuleProperty
constructor
A new instance of ActivatedRuleProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(priority:, rule_id:, action: nil) ⇒ ActivatedRuleProperty
Returns a new instance of ActivatedRuleProperty.
555 556 557 558 559 560 561 562 |
# File 'waf/cfn_web_acl.rb', line 555 def initialize(priority:, rule_id:, action: nil) @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") @action = action.is_a?(Hash) ? ::AWSCDK::WAF::CfnWebACL::WAFActionProperty.new(**action.transform_keys(&:to_sym)) : action Jsii::Type.check_type(@action, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWYuQ2ZuV2ViQUNMLldhZkFjdGlvblByb3BlcnR5In1dfX0=")), "action") unless @action.nil? end |
Instance Attribute Details
#action ⇒ AWSCDK::IResolvable, ... (readonly)
Specifies the action that Amazon CloudFront or AWS WAF takes when a web request matches the conditions in the Rule .
Valid values for Action include the following:
ALLOW: CloudFront responds with the requested object.BLOCK: CloudFront responds with an HTTP 403 (Forbidden) status code.COUNT: AWS WAF increments a counter of requests that match the conditions in the rule and then continues to inspect the web request based on the remaining rules in the web ACL.
ActivatedRule|OverrideAction applies only when updating or adding a RuleGroup to a WebACL . In this case, you do not use ActivatedRule|Action . For all other update requests, ActivatedRule|Action is used instead of ActivatedRule|OverrideAction .
592 593 594 |
# File 'waf/cfn_web_acl.rb', line 592 def action @action end |
#priority ⇒ Numeric (readonly)
Specifies the order in which the Rules in a WebACL are evaluated.
Rules with a lower value for Priority are evaluated before Rules with a higher value. The value must be a unique integer. If you add multiple Rules to a WebACL , the values don't need to be consecutive.
570 571 572 |
# File 'waf/cfn_web_acl.rb', line 570 def priority @priority end |
#rule_id ⇒ String (readonly)
The RuleId for a Rule .
You use RuleId to get more information about a Rule , update a Rule , insert a Rule into a WebACL or delete a one from a WebACL , or delete a Rule from AWS WAF .
RuleId is returned by CreateRule and by ListRules .
579 580 581 |
# File 'waf/cfn_web_acl.rb', line 579 def rule_id @rule_id end |
Class Method Details
.jsii_properties ⇒ Object
594 595 596 597 598 599 600 |
# File 'waf/cfn_web_acl.rb', line 594 def self.jsii_properties { :priority => "priority", :rule_id => "ruleId", :action => "action", } end |
Instance Method Details
#to_jsii ⇒ Object
602 603 604 605 606 607 608 609 610 |
# File 'waf/cfn_web_acl.rb', line 602 def to_jsii result = {} result.merge!({ "priority" => @priority, "ruleId" => @rule_id, "action" => @action, }) result.compact end |