Class: AWSCDK::CfnRuleProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CfnRuleProps
- Defined in:
- cfn_rule_props.rb
Overview
A rule can include a RuleCondition property and must include an Assertions property.
For each rule, you can define only one rule condition; you can define one or more asserts within the Assertions property. You define a rule condition and assertions by using rule-specific intrinsic functions.
You can use the following rule-specific intrinsic functions to define rule conditions and assertions:
Fn::And Fn::Contains Fn::EachMemberEquals Fn::EachMemberIn Fn::Equals Fn::If Fn::Not Fn::Or Fn::RefAll Fn::ValueOf Fn::ValueOfAll
Instance Attribute Summary collapse
-
#assertions ⇒ Array<AWSCDK::CfnRuleAssertion>?
readonly
Assertions which define the rule.
-
#rule_condition ⇒ AWSCDK::ICfnConditionExpression?
readonly
If the rule condition evaluates to false, the rule doesn't take effect.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(assertions: nil, rule_condition: nil) ⇒ CfnRuleProps
constructor
A new instance of CfnRuleProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(assertions: nil, rule_condition: nil) ⇒ CfnRuleProps
Returns a new instance of CfnRuleProps.
28 29 30 31 32 33 |
# File 'cfn_rule_props.rb', line 28 def initialize(assertions: nil, rule_condition: nil) @assertions = assertions.is_a?(Array) ? assertions.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnRuleAssertion.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : assertions Jsii::Type.check_type(@assertions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblJ1bGVBc3NlcnRpb24ifSwia2luZCI6ImFycmF5In19")), "assertions") unless @assertions.nil? @rule_condition = rule_condition Jsii::Type.check_type(@rule_condition, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JQ2ZuQ29uZGl0aW9uRXhwcmVzc2lvbiJ9")), "ruleCondition") unless @rule_condition.nil? end |
Instance Attribute Details
#assertions ⇒ Array<AWSCDK::CfnRuleAssertion>? (readonly)
Default: - No assertions for the rule.
Assertions which define the rule.
39 40 41 |
# File 'cfn_rule_props.rb', line 39 def assertions @assertions end |
#rule_condition ⇒ AWSCDK::ICfnConditionExpression? (readonly)
Default: - Rule's assertions will always take effect.
If the rule condition evaluates to false, the rule doesn't take effect.
If the function in the rule condition evaluates to true, expressions in each assert are evaluated and applied.
46 47 48 |
# File 'cfn_rule_props.rb', line 46 def rule_condition @rule_condition end |
Class Method Details
.jsii_properties ⇒ Object
48 49 50 51 52 53 |
# File 'cfn_rule_props.rb', line 48 def self.jsii_properties { :assertions => "assertions", :rule_condition => "ruleCondition", } end |
Instance Method Details
#to_jsii ⇒ Object
55 56 57 58 59 60 61 62 |
# File 'cfn_rule_props.rb', line 55 def to_jsii result = {} result.merge!({ "assertions" => @assertions, "ruleCondition" => @rule_condition, }) result.compact end |