Class: AWSCDK::EKSv2::ServiceAccountProps

Inherits:
ServiceAccountOptions
  • Object
show all
Defined in:
ek_sv2/service_account_props.rb

Overview

Properties for defining service accounts.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(annotations: nil, identity_type: nil, labels: nil, name: nil, namespace: nil, overwrite_service_account: nil, removal_policy: nil, cluster:) ⇒ ServiceAccountProps

Returns a new instance of ServiceAccountProps.

Parameters:

  • annotations (Hash{String => String}, nil) (defaults to: nil)

    Additional annotations of the service account.

  • identity_type (AWSCDK::EKSv2::IdentityType, nil) (defaults to: nil)

    The identity type to use for the service account.

  • labels (Hash{String => String}, nil) (defaults to: nil)

    Additional labels of the service account.

  • name (String, nil) (defaults to: nil)

    The name of the service account.

  • namespace (String, nil) (defaults to: nil)

    The namespace of the service account.

  • overwrite_service_account (Boolean, nil) (defaults to: nil)

    Overwrite existing service account.

  • removal_policy (AWSCDK::RemovalPolicy, nil) (defaults to: nil)

    The removal policy applied to the service account resources.

  • cluster (AWSCDK::EKSv2::ICluster)

    The cluster to apply the patch to.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'ek_sv2/service_account_props.rb', line 15

def initialize(annotations: nil, identity_type: nil, labels: nil, name: nil, namespace: nil, overwrite_service_account: nil, removal_policy: nil, cluster:)
  @annotations = annotations
  Jsii::Type.check_type(@annotations, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "annotations") unless @annotations.nil?
  @identity_type = identity_type
  Jsii::Type.check_type(@identity_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzX3YyLklkZW50aXR5VHlwZSJ9")), "identityType") unless @identity_type.nil?
  @labels = labels
  Jsii::Type.check_type(@labels, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "labels") unless @labels.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
  @namespace = namespace
  Jsii::Type.check_type(@namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "namespace") unless @namespace.nil?
  @overwrite_service_account = 
  Jsii::Type.check_type(@overwrite_service_account, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "overwriteServiceAccount") unless @overwrite_service_account.nil?
  @removal_policy = removal_policy
  Jsii::Type.check_type(@removal_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "removalPolicy") unless @removal_policy.nil?
  @cluster = cluster
  Jsii::Type.check_type(@cluster, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzX3YyLklDbHVzdGVyIn0=")), "cluster")
end

Instance Attribute Details

#annotationsHash{String => String}? (readonly)

Note:

Default: - no additional annotations

Additional annotations of the service account.

Returns:

  • (Hash{String => String}, nil)


38
39
40
# File 'ek_sv2/service_account_props.rb', line 38

def annotations
  @annotations
end

#clusterAWSCDK::EKSv2::ICluster (readonly)

The cluster to apply the patch to.



89
90
91
# File 'ek_sv2/service_account_props.rb', line 89

def cluster
  @cluster
end

#identity_typeAWSCDK::EKSv2::IdentityType? (readonly)

Note:

Default: IdentityType.IRSA

The identity type to use for the service account.

Returns:



43
44
45
# File 'ek_sv2/service_account_props.rb', line 43

def identity_type
  @identity_type
end

#labelsHash{String => String}? (readonly)

Note:

Default: - no additional labels

Additional labels of the service account.

Returns:

  • (Hash{String => String}, nil)


48
49
50
# File 'ek_sv2/service_account_props.rb', line 48

def labels
  @labels
end

#nameString? (readonly)

Note:

Default: - If no name is given, it will use the id of the resource.

The name of the service account.

The name of a ServiceAccount object must be a valid DNS subdomain name. https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/

Returns:

  • (String, nil)


56
57
58
# File 'ek_sv2/service_account_props.rb', line 56

def name
  @name
end

#namespaceString? (readonly)

Note:

Default: "default"

The namespace of the service account.

All namespace names must be valid RFC 1123 DNS labels. https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/#namespaces-and-dns

Returns:

  • (String, nil)


64
65
66
# File 'ek_sv2/service_account_props.rb', line 64

def namespace
  @namespace
end

#overwrite_service_accountBoolean? (readonly)

Note:

Default: false

Overwrite existing service account.

If this is set, we will use kubectl apply instead of kubectl create when the service account is created. Otherwise, if there is already a service account in the cluster with the same name, the operation will fail.

Returns:

  • (Boolean, nil)


73
74
75
# File 'ek_sv2/service_account_props.rb', line 73

def 
  @overwrite_service_account
end

#removal_policyAWSCDK::RemovalPolicy? (readonly)

Note:

Default: RemovalPolicy.DESTROY

The removal policy applied to the service account resources.

The removal policy controls what happens to the resources if they stop being managed by CloudFormation. This can happen in one of three situations:

  • The resource is removed from the template, so CloudFormation stops managing it
  • A change to the resource is made that requires it to be replaced, so CloudFormation stops managing it
  • The stack is deleted, so CloudFormation stops managing all resources in it

Returns:



85
86
87
# File 'ek_sv2/service_account_props.rb', line 85

def removal_policy
  @removal_policy
end

Class Method Details

.jsii_propertiesObject



91
92
93
94
95
96
97
98
99
100
101
102
# File 'ek_sv2/service_account_props.rb', line 91

def self.jsii_properties
  {
    :annotations => "annotations",
    :identity_type => "identityType",
    :labels => "labels",
    :name => "name",
    :namespace => "namespace",
    :overwrite_service_account => "overwriteServiceAccount",
    :removal_policy => "removalPolicy",
    :cluster => "cluster",
  }
end

Instance Method Details

#to_jsiiObject



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'ek_sv2/service_account_props.rb', line 104

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "annotations" => @annotations,
    "identityType" => @identity_type,
    "labels" => @labels,
    "name" => @name,
    "namespace" => @namespace,
    "overwriteServiceAccount" => @overwrite_service_account,
    "removalPolicy" => @removal_policy,
    "cluster" => @cluster,
  })
  result.compact
end