Class: AWSCDK::EKS::AccessScope

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
eks/access_scope.rb

Overview

Represents the scope of an access policy.

The scope defines the namespaces or cluster-level access granted by the policy.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, namespaces: nil) ⇒ AccessScope

Returns a new instance of AccessScope.

Parameters:

  • type (AWSCDK::EKS::AccessScopeType)

    The scope type of the policy, either 'namespace' or 'cluster'.

  • namespaces (Array<String>, nil) (defaults to: nil)

    A Kubernetes namespace that an access policy is scoped to.



11
12
13
14
15
16
# File 'eks/access_scope.rb', line 11

def initialize(type:, namespaces: nil)
  @type = type
  Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLkFjY2Vzc1Njb3BlVHlwZSJ9")), "type")
  @namespaces = namespaces
  Jsii::Type.check_type(@namespaces, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "namespaces") unless @namespaces.nil?
end

Instance Attribute Details

#namespacesArray<String>? (readonly)

Note:

Default: - no specific namespaces for this scope.

A Kubernetes namespace that an access policy is scoped to.

A value is required if you specified namespace for Type.

Returns:

  • (Array<String>, nil)


29
30
31
# File 'eks/access_scope.rb', line 29

def namespaces
  @namespaces
end

#typeAWSCDK::EKS::AccessScopeType (readonly)

The scope type of the policy, either 'namespace' or 'cluster'.



21
22
23
# File 'eks/access_scope.rb', line 21

def type
  @type
end

Class Method Details

.jsii_propertiesObject



31
32
33
34
35
36
# File 'eks/access_scope.rb', line 31

def self.jsii_properties
  {
    :type => "type",
    :namespaces => "namespaces",
  }
end

Instance Method Details

#to_jsiiObject



38
39
40
41
42
43
44
45
# File 'eks/access_scope.rb', line 38

def to_jsii
  result = {}
  result.merge!({
    "type" => @type,
    "namespaces" => @namespaces,
  })
  result.compact
end