Class: CDK8sPlus25::K8S::KubeClusterRoleProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
k8_s/kube_cluster_role_props.rb

Overview

ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(aggregation_rule: nil, metadata: nil, rules: nil) ⇒ KubeClusterRoleProps

Returns a new instance of KubeClusterRoleProps.

Parameters:



10
11
12
13
14
15
16
17
# File 'k8_s/kube_cluster_role_props.rb', line 10

def initialize(aggregation_rule: nil, metadata: nil, rules: nil)
  @aggregation_rule = aggregation_rule.is_a?(Hash) ? ::CDK8sPlus25::K8S::AggregationRule.new(**aggregation_rule.transform_keys(&:to_sym)) : aggregation_rule
  Jsii::Type.check_type(@aggregation_rule, "eyJmcW4iOiJjZGs4cy1wbHVzLTI1Lms4cy5BZ2dyZWdhdGlvblJ1bGUifQ==", "aggregationRule") unless @aggregation_rule.nil?
  @metadata = .is_a?(Hash) ? ::CDK8sPlus25::K8S::ObjectMeta.new(**.transform_keys(&:to_sym)) : 
  Jsii::Type.check_type(@metadata, "eyJmcW4iOiJjZGs4cy1wbHVzLTI1Lms4cy5PYmplY3RNZXRhIn0=", "metadata") unless @metadata.nil?
  @rules = rules.is_a?(Array) ? rules.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::CDK8sPlus25::K8S::PolicyRule.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : rules
  Jsii::Type.check_type(@rules, "eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImNkazhzLXBsdXMtMjUuazhzLlBvbGljeVJ1bGUifSwia2luZCI6ImFycmF5In19", "rules") unless @rules.nil?
end

Instance Attribute Details

#aggregation_ruleCDK8sPlus25::K8S::AggregationRule? (readonly)

AggregationRule is an optional field that describes how to build the Rules for this ClusterRole.

If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be stomped by the controller.



24
25
26
# File 'k8_s/kube_cluster_role_props.rb', line 24

def aggregation_rule
  @aggregation_rule
end

#metadataCDK8sPlus25::K8S::ObjectMeta? (readonly)

Standard object's metadata.



28
29
30
# File 'k8_s/kube_cluster_role_props.rb', line 28

def 
  @metadata
end

#rulesArray<CDK8sPlus25::K8S::PolicyRule>? (readonly)

Rules holds all the PolicyRules for this ClusterRole.

Returns:



32
33
34
# File 'k8_s/kube_cluster_role_props.rb', line 32

def rules
  @rules
end

Class Method Details

.jsii_propertiesObject



34
35
36
37
38
39
40
# File 'k8_s/kube_cluster_role_props.rb', line 34

def self.jsii_properties
  {
    :aggregation_rule => "aggregationRule",
    :metadata => "metadata",
    :rules => "rules",
  }
end

Instance Method Details

#to_jsiiObject



42
43
44
45
46
47
48
49
50
# File 'k8_s/kube_cluster_role_props.rb', line 42

def to_jsii
  result = {}
  result.merge!({
    "aggregationRule" => @aggregation_rule,
    "metadata" => @metadata,
    "rules" => @rules,
  })
  result.compact
end