Class: AWSCDK::CfnRuleProps

Inherits:
Jsii::Struct
  • Object
show all
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

https://docs.aws.amazon.com/servicecatalog/latest/adminguide/reference-template_constraint_rules.html

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(assertions: nil, rule_condition: nil) ⇒ CfnRuleProps

Returns a new instance of CfnRuleProps.

Parameters:



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

#assertionsArray<AWSCDK::CfnRuleAssertion>? (readonly)

Note:

Default: - No assertions for the rule.

Assertions which define the rule.

Returns:



39
40
41
# File 'cfn_rule_props.rb', line 39

def assertions
  @assertions
end

#rule_conditionAWSCDK::ICfnConditionExpression? (readonly)

Note:

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_propertiesObject



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_jsiiObject



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