Class: AWSCDK::EKSv2::ServiceAccountOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ek_sv2/service_account_options.rb

Overview

Options for ServiceAccount.

Direct Known Subclasses

ServiceAccountProps

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) ⇒ ServiceAccountOptions

Returns a new instance of ServiceAccountOptions.

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.



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

def initialize(annotations: nil, identity_type: nil, labels: nil, name: nil, namespace: nil, overwrite_service_account: nil, removal_policy: nil)
  @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?
end

Instance Attribute Details

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

Note:

Default: - no additional annotations

Additional annotations of the service account.

Returns:

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


35
36
37
# File 'ek_sv2/service_account_options.rb', line 35

def annotations
  @annotations
end

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

Note:

Default: IdentityType.IRSA

The identity type to use for the service account.

Returns:



40
41
42
# File 'ek_sv2/service_account_options.rb', line 40

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)


45
46
47
# File 'ek_sv2/service_account_options.rb', line 45

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)


53
54
55
# File 'ek_sv2/service_account_options.rb', line 53

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)


61
62
63
# File 'ek_sv2/service_account_options.rb', line 61

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)


70
71
72
# File 'ek_sv2/service_account_options.rb', line 70

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:



82
83
84
# File 'ek_sv2/service_account_options.rb', line 82

def removal_policy
  @removal_policy
end

Class Method Details

.jsii_propertiesObject



84
85
86
87
88
89
90
91
92
93
94
# File 'ek_sv2/service_account_options.rb', line 84

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

Instance Method Details

#to_jsiiObject



96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'ek_sv2/service_account_options.rb', line 96

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