Class: AWSCDK::PolicyViolationBeta1 Deprecated
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::PolicyViolationBeta1
- Defined in:
- policy_violation_beta1.rb
Overview
Use PolicyViolation instead.
Violation produced by the validation plugin.
Instance Attribute Summary collapse
-
#description ⇒ String
readonly
The description of the violation.
-
#fix ⇒ String?
readonly
How to fix the violation.
-
#rule_metadata ⇒ Hash{String => String}?
readonly
Additional metadata to include with the rule results.
-
#rule_name ⇒ String
readonly
The name of the rule.
-
#severity ⇒ String?
readonly
The severity of the violation, only used for reporting purposes.
-
#violating_resources ⇒ Array<AWSCDK::PolicyViolatingResourceBeta1>
readonly
The resources violating this rule.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(description:, rule_name:, violating_resources:, fix: nil, rule_metadata: nil, severity: nil) ⇒ PolicyViolationBeta1
constructor
A new instance of PolicyViolationBeta1.
- #to_jsii ⇒ Object
Constructor Details
#initialize(description:, rule_name:, violating_resources:, fix: nil, rule_metadata: nil, severity: nil) ⇒ PolicyViolationBeta1
Returns a new instance of PolicyViolationBeta1.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'policy_violation_beta1.rb', line 15 def initialize(description:, rule_name:, violating_resources:, fix: nil, rule_metadata: nil, severity: nil) @description = description Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") @rule_name = rule_name Jsii::Type.check_type(@rule_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ruleName") @violating_resources = violating_resources.is_a?(Array) ? violating_resources.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::PolicyViolatingResourceBeta1.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : violating_resources Jsii::Type.check_type(@violating_resources, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLlBvbGljeVZpb2xhdGluZ1Jlc291cmNlQmV0YTEifSwia2luZCI6ImFycmF5In19")), "violatingResources") @fix = fix Jsii::Type.check_type(@fix, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "fix") unless @fix.nil? @rule_metadata = Jsii::Type.check_type(@rule_metadata, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "ruleMetadata") unless @rule_metadata.nil? @severity = severity Jsii::Type.check_type(@severity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "severity") unless @severity.nil? end |
Instance Attribute Details
#description ⇒ String (readonly)
The description of the violation.
33 34 35 |
# File 'policy_violation_beta1.rb', line 33 def description @description end |
#fix ⇒ String? (readonly)
Default: - no fix is provided
How to fix the violation.
46 47 48 |
# File 'policy_violation_beta1.rb', line 46 def fix @fix end |
#rule_metadata ⇒ Hash{String => String}? (readonly)
Default: - no rule metadata
Additional metadata to include with the rule results.
This can be used to provide additional information that is plugin specific. The data provided here will be rendered as is.
54 55 56 |
# File 'policy_violation_beta1.rb', line 54 def @rule_metadata end |
#rule_name ⇒ String (readonly)
The name of the rule.
37 38 39 |
# File 'policy_violation_beta1.rb', line 37 def rule_name @rule_name end |
#severity ⇒ String? (readonly)
Default: - no severity
The severity of the violation, only used for reporting purposes.
This is useful for helping the user discriminate between warnings, errors, information, etc.
62 63 64 |
# File 'policy_violation_beta1.rb', line 62 def severity @severity end |
#violating_resources ⇒ Array<AWSCDK::PolicyViolatingResourceBeta1> (readonly)
The resources violating this rule.
41 42 43 |
# File 'policy_violation_beta1.rb', line 41 def violating_resources @violating_resources end |
Class Method Details
.jsii_properties ⇒ Object
64 65 66 67 68 69 70 71 72 73 |
# File 'policy_violation_beta1.rb', line 64 def self.jsii_properties { :description => "description", :rule_name => "ruleName", :violating_resources => "violatingResources", :fix => "fix", :rule_metadata => "ruleMetadata", :severity => "severity", } end |
Instance Method Details
#to_jsii ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'policy_violation_beta1.rb', line 75 def to_jsii result = {} result.merge!({ "description" => @description, "ruleName" => @rule_name, "violatingResources" => @violating_resources, "fix" => @fix, "ruleMetadata" => @rule_metadata, "severity" => @severity, }) result.compact end |